@somnia-chain/markets-sdk


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

Function: useWatchPerpMarkets()

useWatchPerpMarkets(opts?): WatchStatus

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

Hold the perp-PLANE watch while mounted and report its state.

One watch for the whole venue, so mounting this in several components is one subscription and one snapshot — the refcount is what makes a liquidation feed and a funding-settlement feed on the same page cost one of each.

MOUNT THIS ABOVE useLiveLiquidations / useLiveFundingPayments when the deployment needs opts.marginBank. Those two acquire the plane themselves, with no hint to give — which is enough everywhere the indexer has a perp market row, and is exactly the case the hint does not cover.

Background acquisition failures use the configured debug/console warning channel. Use useWatchPerpMarketsResult for inline error UI.

Parameters

opts?

UseWatchPerpMarketsOptions

Returns

WatchStatus

Throws

No Markets provider is mounted.