This hook requires the
OrderbookProvider to be present in your component tree to provide the underlying Orderbook instance.Import
Usage
Parameters
This hook does not accept any parameters. It automatically connects to theOrderbook instance provided by the nearest context provider.
Return Type
State
Actions
Updates the trading pair. Note: This will clear existing data and trigger a new WebSocket subscription.
Updates the Kraken subscription depth. Triggers a WebSocket re-subscription.
Adjusts the number of levels filtered from the local cache. Does not trigger a re-subscription.
Examples
Performance Tuning
Switch between throttling for high-frequency updates or debouncing for a “calmer” UI experience.Depth vs. Limit Management
depth controls how much data we request from Kraken, while limit controls how much we actually show in the UI.
Related
Orderbook Core
Explore the underlying class logic and event emitters.
useOrderbookConnection
Access and modify the orderbook websocket connection.
useAssetPairs
Find valid symbols to pass to
setSymbol.Kraken API
Explore the
book channel streams level 2 order book docs.
