TL;DR:
- Kraken’s API gives real-time and historic market information feeds to completely different technique varieties: L2 order e book depth for execution algorithms, OHLCV and commerce historical past for backtesting, funding fee information for carry methods, and ticker feeds for momentum indicators.
- Systematic merchants sometimes use 2–3 feeds primarily based on technique sort, over-subscribing provides overhead with out enhancing sign high quality.
Understanding which API endpoints exist doesn’t let you know which feeds to truly use. Execution algorithms generally use L2 e book depth 10 slightly than 1,000. Momentum methods sometimes don’t want an order e book in any respect. And if you happen to’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 provide?
- Actual-time feeds: Ticker (worth/quantity), order e book (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 e book information on your crypto buying and selling technique?
Ticker information gives greatest bid, greatest ask, and final worth. However if you happen to’re executing measurement, ticker alone doesn’t let you know how a lot liquidity sits behind these costs.
L2 (aggregated orders)
Order e book (L2) exhibits aggregated depth throughout a number of worth ranges. This issues if you’re sizing orders to keep away from slippage. Should you’re promoting 5 BTC and the perfect bid solely has 0.08 BTC of depth, you’ll transfer via a number of ranges. L2 exhibits you this earlier than you ship the order.
L3 (particular person orders)
L3 gives a full order-by-order view of all resting orders within the e book, together with order IDs and timestamps. This permits queue precedence evaluation; you possibly can decide the place any order, together with your personal, sits within the queue at every worth degree, 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 primary value is payload measurement: L3 describes each particular person order within the e book slightly than cumulative amount at every worth degree, which suggests extra information to encode, transmit, and decode. Should you can’t articulate why you want particular person order visibility, L2 is enough for many systematic methods.
Depth choices
The WebSocket e book 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 influence modeling or analyzing deep liquidity and are extra compute-intensive to take care of.
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 real looking. In case your backtest assumes you possibly can fill 10 BTC at bid with out slippage, it’s best to validate that towards commerce historical past. Pull the commerce feed to verify that quantity truly traded at these ranges throughout your backtest interval.
WebSocket vs REST for OHLCV: Use WebSocket if you happen to want the present candle up to date in real-time as trades occur, slightly than polling for a accomplished candle.
How do you utilize Kraken’s funding fee information for carry methods?
Funding fee carry methods harvest the periodic funds between longs and shorts on perpetual futures. You want present charges for reside monitoring (futures ticker gives 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 threat and unrealized P&L. The index worth is the real-time spot reference worth utilized in funding fee calculations. Throughout unstable intervals, mark worth and index worth can diverge; when that unfold widens, it indicators foundation threat or liquidation strain, one thing carry merchants want to watch intently. The final traded worth is a separate determine reflecting the latest fill and isn’t the related comparability for assessing liquidation threat.
What are the commonest errors when utilizing crypto market information feeds?
- Utilizing WebSocket for all the pieces: Should you’re backtesting or operating gradual methods, REST polling is easier.
- Assuming L3 is important.: Should you can’t clarify why you want particular person order visibility and queue place information throughout the complete e book, you in all probability don’t want L3. Order e book 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 by way of REST. These are public (no authentication), easy to combine, and canopy most of preliminary technique improvement. Add order e book and commerce feeds if you transfer to reside execution.
For knowledgeable merchants:
- Determine your technique sort: Execution algo, backtest, momentum, and so forth
- Choose 2-3 feeds: Don’t over-subscribe, begin with what instantly 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 e book (L2), trades, and OHLCV) don’t require authentication. L3 particular person order information requires authentication.
What’s the distinction between L2 and L3 order e book 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 e book with order IDs and timestamps, enabling queue precedence evaluation, fill likelihood estimation, and market microstructure evaluation. L3 requires authentication. Should you can’t clarify why you want full particular person order visibility, you in all probability don’t want it.
Ought to I take advantage of WebSocket or REST for crypto market information?
Use WebSocket if you happen to want the present candle up to date in real-time as trades occur, slightly than polling for a accomplished candle.
What information feeds do I would like for a crypto execution algorithm?
Execution algorithms generally use L2 order e book depth. The WebSocket e book 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 influence modeling and analyzing deep liquidity. Ticker information alone is inadequate when executing measurement as a result of it doesn’t present liquidity behind greatest bid/ask.