@somnia-chain/markets-sdk


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

Interface: UnifiedFundingRate

Defined in: packages/sdk/src/unified/structs.ts:401

A perp funding-rate snapshot (live chain read; rates are fractions, not %).

Properties

symbol

symbol: string

Defined in: packages/sdk/src/unified/structs.ts:403

The perp's tradable symbol, e.g. "BTC/USDSO:USDSO".


markPrice

markPrice: number | undefined

Defined in: packages/sdk/src/unified/structs.ts:411

Mark price, human quote units.

Undefined when the mark feed is stale — a live read reports that explicitly, and a historical row carries the contract's 0 sentinel, neither of which should be flattened to a price of zero.


indexPrice

indexPrice: number

Defined in: packages/sdk/src/unified/structs.ts:413

Oracle index price, human quote units.


fundingRate

fundingRate: number

Defined in: packages/sdk/src/unified/structs.ts:429

Funding rate per 8 HOURS as a plain fraction (0.0001 = 0.01%).

Normalized to a fixed 8h axis (the Hyperliquid/Binance convention) from the chain's per-calculation-window value, so it stays comparable across a parameter change. NOT the amount charged at each settlement: that is this divided by n = fundingWindowSec / fundingIntervalSec, which is 8 on every live pool and has been 96 at a 300s cadence. info carries both figures.

On a HISTORICAL row that caught up over several intervals, rate / n is only ONE interval's worth: the amount that settlement actually charged is rate * intervalsAccrued / n. Rows at the deployed one-interval horizon have intervalsAccrued of 1, so the two agree there and disagree only on older catch-up rows.


fundingTimestamp?

optional fundingTimestamp?: number

Defined in: packages/sdk/src/unified/structs.ts:437

When funding next settles, or when this row settled (ms).

For a live read this is the last settlement anchor plus the settlement interval; because settlement is permissionless and LAZY it can be in the past, which means a settlement is due rather than that anything is wrong.


timestamp

timestamp: number

Defined in: packages/sdk/src/unified/structs.ts:439

When this snapshot was read (ms, local clock).


datetime

datetime: string

Defined in: packages/sdk/src/unified/structs.ts:441

ISO-8601 of timestamp.


info

info: unknown

Defined in: packages/sdk/src/unified/structs.ts:443

The native on-chain perp state (raw 1e18/quote-unit bigints).