@somnia-chain/markets-sdk


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

Type Alias: FundingRateUpdate

FundingRateUpdate = object

Defined in: packages/sdk/src/perp/history.ts:200

A funding-rate history point (mirror of the indexer FundingRateUpdate entity) — the append-only counterpart to the market row's overwrite-only funding fields.

Properties

id

id: string

Defined in: packages/sdk/src/perp/history.ts:202

Update id (${pool}_${block}_${logIndex}).


pool

pool: string

Defined in: packages/sdk/src/perp/history.ts:204

Perp pool (lowercased).


fundingRate

fundingRate: string

Defined in: packages/sdk/src/perp/history.ts:210

Rate applied to THIS settlement, per CALCULATION WINDOW, 1e18-scaled, signed. Normalize with fundingWindowSec on this same row — see normalizeFundingRate.


cumulativeFundingPerUnit

cumulativeFundingPerUnit: string

Defined in: packages/sdk/src/perp/history.ts:217

Cumulative funding index AFTER this settlement (1e18 x quote units per whole base, signed, NOT monotonic). The ground truth for accrual: realized funding over any range is exactly (end - start) / 1e18 raw quote units per whole base, with no interpolation and no gap reasoning. See realizedFundingPerBase.


indexPrice

indexPrice: string

Defined in: packages/sdk/src/perp/history.ts:219

Oracle index price at the update (raw quote per whole base, 18dp).


markPrice

markPrice: string | null

Defined in: packages/sdk/src/perp/history.ts:225

Best-effort mark-price cross-check. NULL when the contract emitted its 0 sentinel for a stale/reverting mark feed — never a price of zero. Unrelated to the premium driving the rate, which is book-MIDPOINT vs index.


intervalsSettled

intervalsSettled: string

Defined in: packages/sdk/src/perp/history.ts:227

Intervals spanned, UNCLAMPED, as emitted. Can exceed n after an outage.


intervalsAccrued

intervalsAccrued: string

Defined in: packages/sdk/src/perp/history.ts:232

What actually accrued: min(intervalsSettled, n). The excess is forgiven by the contract's catch-up cap, and the forgiven intervals are the OLDEST ones.


fundingWindowSec

fundingWindowSec: number

Defined in: packages/sdk/src/perp/history.ts:234

The rate's denominator in seconds, in force at this emit. Makes the row self-normalizing.


fundingIntervalSec

fundingIntervalSec: number

Defined in: packages/sdk/src/perp/history.ts:236

Settlement cadence in seconds, in force at this emit.


spanStart

spanStart: string

Defined in: packages/sdk/src/perp/history.ts:243

Wall-clock span this settlement's accrual covers — the last intervalsAccrued intervals ending at the settlement anchor. It reaches BACKWARDS from the emit, up to a full window, which is why a funding chart must distribute a row across the buckets its span overlaps rather than credit it to the bucket containing it.


spanEnd

spanEnd: string

Defined in: packages/sdk/src/perp/history.ts:244


anchorResynced

anchorResynced: boolean

Defined in: packages/sdk/src/perp/history.ts:251

True when the settlement anchor had to be re-derived because the chain advanced it with NO event — the stale-oracle-with-zero-open-interest branch, where funding is permanently forgiven at zero and nothing is logged. A run of these means some funding time is covered by no row at all.


timestamp

timestamp: string

Defined in: packages/sdk/src/perp/history.ts:253

Timestamp (unix seconds) of the update.


blockNumber

blockNumber: string

Defined in: packages/sdk/src/perp/history.ts:254


txHash

txHash: string

Defined in: packages/sdk/src/perp/history.ts:255