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
The current trading pair symbol (e.g., “BTC/USD”).
The maximum number of visible price levels returned in the data updates.
The subscription depth requested from the Kraken WebSocket.
A generated list of 9 user-friendly grouping steps (1x, 2x, 5x, 10x… of tickSize).
The step size for price grouping (aggregation). Defaults to 0 (no grouping).
The interval in milliseconds used to throttle outgoing data updates.
The interval in milliseconds used to debounce outgoing data updates.
Whether the instance is currently recording historical snapshots.
The maximum number of snapshots stored in the history buffer.
Whether verbose logging is enabled for the orderbook instance.
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.
Updates the base increment. This regenerates the groupingOptions.
Updates the price aggregation step size.
Configures the throttle interval for the update pipeline.
Configures the debounce interval for the update pipeline.
Toggles the recording of historical snapshots.
Resizes the internal history buffer.
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.

