@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / TailStatus

Interface: TailStatus

Defined in: packages/sdk/src/store.ts:131

Live-tail health snapshot — how current the store's getLive* reads are: block coverage (snapshot/last/head), socket state, and active watch count.

Properties

healedGaps

healedGaps: number

Defined in: packages/sdk/src/store.ts:133

Nonempty intervening ranges successfully recovered. Empty probes do not count.


lastDivergence

lastDivergence: TailDivergence | null

Defined in: packages/sdk/src/store.ts:135

Last observed divergence, retained after later matching checks.


failure

failure: TailFailure | null

Defined in: packages/sdk/src/store.ts:137

Background failure; cleared only after the failed work succeeds.


mode

mode: TailMode

Defined in: packages/sdk/src/store.ts:139

Current data-source mode ("init" until the first watch is hydrated).


seedSource

seedSource: SeedSource | null

Defined in: packages/sdk/src/store.ts:150

Where the most recent watch took its book seed: "indexer" for the indexer snapshot (the default), "chain" for a seed: "chain" watch. null in "init", before any watch has hydrated.

LATEST SEED, not an aggregate. This field and the three below describe the most recent seed only, so with several watched pools they cannot be attributed to a pool. Read PoolSeedStatus through getSeedStatus(pool) for a per-pool answer.


seedBlock

seedBlock: number

Defined in: packages/sdk/src/store.ts:157

Block the seed was consistent to — the indexer snapshot block, or the pinned block every chain-seed page was read at. 0 before any watch has hydrated. Equal to TailStatus.snapshotBlock; this field names the value, while seedSource names where it came from.


seedTruncated

seedTruncated: boolean

Defined in: packages/sdk/src/store.ts:163

Whether the chain seed hit its page budget and read a SHALLOW book. Always false for an indexer seed. A truncated seed is a successful bounded read, not a failure — the book is real but incomplete at its deep end.


allMarketsTruncated

allMarketsTruncated: boolean

Defined in: packages/sdk/src/store.ts:177

Whether the active all-markets watch left eligible markets out.

One watchMarkets snapshot hydrates at most 500 eligible markets, newest first. This is true when more exist: the watched markets are complete, but the oldest eligible markets are not watched. Watch those with watchMarket(pool).

Owned by the all-markets scope alone, so a later pool or chain seed does not overwrite it. It stays set while that scope is watched or lingering, and returns to false when the scope is torn down. false when no all-markets watch exists.


fillsLoaded

fillsLoaded: boolean

Defined in: packages/sdk/src/store.ts:187

Whether fill history was loaded for the current scope.

A chain seed cannot reconstruct fills from before its block: the seam backfills only snapshotBlock+1..head, and older fills live only in the indexer. So false plus an empty getLiveFills means "never loaded", while true plus an empty getLiveFills means "genuinely no fills in the loaded range". Without this flag the two are indistinguishable.


snapshotBlock

snapshotBlock: number

Defined in: packages/sdk/src/store.ts:197

Block the most recent watch seed was consistent to — a watch's seam covers snapshotBlock+1.. either way.

For an indexer-seeded watch this is the indexer snapshot block, unchanged. For a chain-seeded watch it is the block every drained page was pinned to, the same value TailStatus.seedBlock reports. Read TailStatus.seedSource to tell the two apart.


lastBlock

lastBlock: number

Defined in: packages/sdk/src/store.ts:199

Highest applied event or sealed scope block; heads alone do not advance it.


headBlock

headBlock: number

Defined in: packages/sdk/src/store.ts:201

Latest chain head observed over the WS


wsConnected

wsConnected: boolean

Defined in: packages/sdk/src/store.ts:203

Whether the chain WS subscriptions are currently delivering


watchCount

watchCount: number

Defined in: packages/sdk/src/store.ts:213

Active watch SCOPES: pools currently subscribed (including an all-markets watch's set), plus the perp plane as one if it is watched.

0 → the tail is idle and no socket is held for it, and that invariant is the point of the field. The perp plane is counted precisely because it holds a socket while subscribing no pool at all, so a pool-only count would report an idle tail that is in fact streaming.