@somnia-chain/markets-sdk


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

Type Alias: PriceFeedStatus

PriceFeedStatus = "unwatched" | "hydrating" | "live" | "error"

Defined in: packages/sdk/src/priceFeed/types.ts:213

Per-asset watch state: "unwatched" (no active watch — live reads return null/empty), "hydrating" (snapshot/subscribe in progress), "live" (streaming; reads are current to the last pushed tick), "error" (the server rejected or terminated this asset's subscription).

Treat "error" as "the data has stopped and will not resume on its own". Reads keep answering with the last values they held, so a view that renders them without checking the status shows a frozen price as a live one. The server sends this for a validation failure (a schema change) or a permission denial, so it will not heal by itself: stop the watch and start a new one. Each rejection is also emitted as a warn event on the client's debug channel (see ClientConfig.debug) with the server payload.