@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / react / useLiveBinaryOrderBook

Function: useLiveBinaryOrderBook()

useLiveBinaryOrderBook(pool, depth?, options?): BinaryOrderBook

Defined in: packages/sdk/src/hooks.ts:519

The locally-materialized resting book of a binary pool (4-sided), updating the moment an order event lands — no round-trips, no refetch interval. Watches the pool while mounted.

Background acquisition failures use the configured debug/console warning channel. Use the corresponding useWatchMarketResult/useWatchUserResult/useWatchPriceResult hook for inline error UI. The owner supplies blockNumber as an applied-event watermark. Heads alone do not advance it. Expiry remains a wall-clock projection.

Parameters

pool

string | undefined

depth?

number = 10

options?

HookChainOptions = {}

Returns

BinaryOrderBook

Throws

No Markets provider is mounted.