TL;DR:
- Kraken’s API supplies real-time and historic market information feeds to completely different technique sorts: L2 order guide depth for execution algorithms, OHLCV and commerce historical past for backtesting, funding charge information for carry methods, and ticker feeds for momentum indicators.
- Systematic merchants usually use 2–3 feeds primarily based on technique sort, over-subscribing provides overhead with out bettering sign high quality.
Figuring out which API endpoints exist doesn’t let you know which feeds to really use. Execution algorithms generally use L2 guide depth 10 reasonably than 1,000. Momentum methods usually don’t want an order guide in any respect. And for those who’re backtesting on 6 months of information, you’re lacking how your technique performs throughout market cycles.
What market information feeds does Kraken’s API supply?
- Actual-time feeds: Ticker (worth/quantity), order guide (L2 depth, L3 particular person orders), trades (executed transactions), OHLCV (streaming candlesticks)
- Historic information: OHLCV, historic funding charges, commerce historical past
- Futures-specific: Mark worth, funding charges, open curiosity
- Entry strategies: WebSocket v2 for real-time, REST for historic, FIX for institutional
Do you want L2 or L3 order guide information to your crypto buying and selling technique?
Ticker information supplies greatest bid, greatest ask, and final worth. However for those who’re executing dimension, ticker alone doesn’t let you know how a lot liquidity sits behind these costs.
L2 (aggregated orders)
Order guide (L2) exhibits aggregated depth throughout a number of worth ranges. This issues once you’re sizing orders to keep away from slippage. In case you’re promoting 5 BTC and the perfect bid solely has 0.08 BTC of depth, you’ll transfer by way of a number of ranges. L2 exhibits you this earlier than you ship the order.
L3 (particular person orders)
L3 supplies a full order-by-order view of all resting orders within the guide, together with order IDs and timestamps. This permits queue precedence evaluation; you may decide the place any order, together with your individual, sits within the queue at every worth stage, in addition to fill likelihood estimation and market microstructure evaluation. L3 is primarily used for sub-second execution or queue place evaluation.
From a efficiency standpoint, the latency distinction between L3 and L2 feeds is negligible in comparison with transport time. The principle price is payload dimension: L3 describes each particular person order within the guide reasonably than cumulative amount at every worth stage, which suggests extra information to encode, transmit, and decode. In case you can’t articulate why you want particular person order visibility, L2 is enough for many systematic methods.
Depth choices
The WebSocket guide channel helps 5 depth ranges — 10, 25, 100, 500, and 1,000. Execution algorithms generally use depth 10, which covers the actionable vary with minimal payload overhead. Depths 500 and 1,000 are used for market affect modeling or analyzing deep liquidity and are extra compute-intensive to keep up.
How do you entry Kraken’s historic market information for backtesting?
OHLCV (candlestick information) is often used for backtesting. Transferring averages, RSI, breakout indicators, all of them use OHLCV as enter.
However OHLCV alone doesn’t let you know in case your execution assumptions are reasonable. In case your backtest assumes you may fill 10 BTC at bid with out slippage, it’s best to validate that towards commerce historical past. Pull the commerce feed to substantiate that quantity truly traded at these ranges throughout your backtest interval.
WebSocket vs REST for OHLCV: Use WebSocket for those who want the present candle up to date in real-time as trades occur, reasonably than polling for a accomplished candle.
How do you utilize Kraken’s funding charge information for carry methods?
Funding charge carry methods harvest the periodic funds between longs and shorts on perpetual futures. You want present charges for stay monitoring (futures ticker supplies this) and historic charges for backtesting.
Mark worth vs. index worth: The futures ticker contains each, together with the final traded worth, three distinct values. Mark worth determines liquidation danger and unrealized P&L. The index worth is the real-time spot reference worth utilized in funding charge calculations. Throughout risky intervals, mark worth and index worth can diverge; when that unfold widens, it indicators foundation danger or liquidation stress, one thing carry merchants want to observe carefully. The final traded worth is a separate determine reflecting the newest fill and isn’t the related comparability for assessing liquidation danger.
What are the commonest errors when utilizing crypto market information feeds?
- Utilizing WebSocket for every part: In case you’re backtesting or working gradual methods, REST polling is easier.
- Assuming L3 is critical.: In case you can’t clarify why you want particular person order visibility and queue place information throughout the total guide, you most likely don’t want L3. Order guide L2 (aggregated depth) is enough for many systematic methods.
- Ignoring historic depth: A backtest on 6 months of information doesn’t present you ways your technique performs throughout market cycles.
How do you get began with market information feeds on Kraken?
New to Kraken’s API? Begin with ticker and OHLCV through REST. These are public (no authentication), easy to combine, and canopy most of preliminary technique improvement. Add order guide and commerce feeds once you transfer to stay execution.
For knowledgeable merchants:
- Determine your technique sort: Execution algo, backtest, momentum, and so on
- Choose 2-3 feeds: Don’t over-subscribe, begin with what immediately feeds your indicators or execution logic
- Create API keys when prepared
- Full API documentation: docs.kraken.com/api
Create your API keys now, or for institutional scale or FIX entry, get in contact:
FAQ
What market information does Kraken’s API present at no cost?
Kraken’s real-time market information feeds (ticker, order guide (L2), trades, and OHLCV) don’t require authentication. L3 particular person order information requires authentication.
What’s the distinction between L2 and L3 order guide information on Kraken?
L2 exhibits aggregated depth throughout worth ranges, which is enough for many systematic methods. L3 exhibits all particular person resting orders within the guide with order IDs and timestamps, enabling queue precedence evaluation, fill likelihood estimation, and market microstructure evaluation. L3 requires authentication. In case you can’t clarify why you want full particular person order visibility, you most likely don’t want it.
Ought to I exploit WebSocket or REST for crypto market information?
Use WebSocket for those who want the present candle up to date in real-time as trades occur, reasonably than polling for a accomplished candle.
What information feeds do I want for a crypto execution algorithm?
Execution algorithms generally use L2 order guide depth. The WebSocket guide channel helps depths of 10, 25, 100, 500, and 1,000. Depth 10 is the usual place to begin and covers the actionable vary. Depths of 500 and 1,000 are used for market affect modeling and analyzing deep liquidity. Ticker information alone is inadequate when executing dimension as a result of it doesn’t present liquidity behind greatest bid/ask.
