Skip to main content
This hook requires the OrderbookProvider to be present in your component tree to provide the underlying Orderbook instance.

Import


Usage


Parameters

boolean
default:false
If true, the hook will unsubscribe from the data pipeline and stop updating state. Useful for optimizing performance in background tabs or collapsed UI elements.

Return Type

Returns an OrderbookData object containing:

State

Level[]
An array of ask price levels (sorted ascending).
Level[]
An array of bid price levels (sorted descending).
number
The absolute difference between the best ask and best bid.
number
The spread expressed as a percentage of the best ask.
number
The highest cumulative total across both sides, used for calculating depth bar widths.
number
The unix timestamp (ms) of when this update was generated.

Orderbook Core

Explore the underlying class logic and event emitters.

useOrderbookHistory

Access historical orderbook data.

useOrderbookStatus

Check if the data is currently “live” or “disconnected”.

Kraken API

Explore the book channel streams level 2 order book docs.