@somnia-chain/markets-sdk / index / PriceFeedInfo
Interface: PriceFeedInfo
Defined in: packages/sdk/src/priceFeed/types.ts:129
Feed metadata + current price for one asset — the Feed singleton, parsed.
Properties
asset
asset:
string
Defined in: packages/sdk/src/priceFeed/types.ts:131
Asset key (the pair's base, e.g. BTC), uppercased.
decimals
decimals:
number
Defined in: packages/sdk/src/priceFeed/types.ts:133
Price scale (Feed.decimals — always 18 today; raw values are 10^decimals-scaled).
symbol
symbol:
string|null
Defined in: packages/sdk/src/priceFeed/types.ts:135
The feed's on-chain pair symbol, e.g. BTC/USDT.
base
base:
string|null
Defined in: packages/sdk/src/priceFeed/types.ts:137
Base asset, e.g. BTC.
quote
quote:
string|null
Defined in: packages/sdk/src/priceFeed/types.ts:139
Quote asset, e.g. USDT.
description
description:
string|null
Defined in: packages/sdk/src/priceFeed/types.ts:141
Free-form feed description from the scheduler, or null when unset.
updatedAtMs
updatedAtMs:
number|null
Defined in: packages/sdk/src/priceFeed/types.ts:152
When the oracle last WROTE this feed — unix milliseconds, or null if unknown. This is the freshness signal to judge a price by: the feed ticks ~1/s, so an age beyond a few seconds means the asset has stalled.
A live subscription does NOT keep this moving on a stalled asset — a feed
that stops updating simply stops pushing, so the value freezes and its age
grows. Compute age against a local clock (Date.now() - updatedAtMs) and
re-render on a timer; do not wait for a data event that will never arrive.
sourceUpdatedAtMs
sourceUpdatedAtMs:
number|null
Defined in: packages/sdk/src/priceFeed/types.ts:160
When the underlying market data was timestamped at the SOURCE — unix
milliseconds, or null if unknown. Compare against updatedAtMs to
separate "the oracle stopped writing" from "the oracle is writing, but with
stale source data": a large updatedAtMs - sourceUpdatedAtMs gap means the
price was already old when it landed on chain.
resynced
resynced:
boolean|null
Defined in: packages/sdk/src/priceFeed/types.ts:165
Whether the last write was a resync (a correction/backfill rather than a routine tick), or null if unknown.
latest
latest:
LivePrice|null
Defined in: packages/sdk/src/priceFeed/types.ts:170
Current price (same value a live watch keeps current), or null if the feed has no observations yet.