@somnia-chain/markets-sdk


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

Function: useLiveLiquidations()

useLiveLiquidations(opts?): LiquidationEvent[]

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

Liquidation waterfall legs the live tail has seen, NEWEST FIRST. Holds the perp-plane watch while mounted.

Rows are the same LiquidationEvent the indexed getLiquidations serves, so a live feed and a paged history render through one component. One liquidation is SEVERAL rows sharing a txHash — read kind to tell the stages apart, and read the field TSDoc before aggregating: badDebt and deficit are levels that double-count when summed.

A pool filter drops the account-level legs, which name no pool. Pass account for one wallet's whole story. Pass chainId to read another chain the provider spans.

Acquires the plane itself, with no MarginBank hint — mount useWatchPerpMarkets above it on a deployment whose indexer has no perp market row to read the bank from.

Background acquisition failures use the configured debug/console warning channel. Use useWatchPerpMarketsResult for inline error UI — without it a failed plane and a venue with no liquidations render identically.

Parameters

opts?

UseLiveLiquidationsOptions

Returns

LiquidationEvent[]

Throws

No Markets provider is mounted.