@somnia-chain/markets-sdk


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

Function: intervalsPerWindow()

intervalsPerWindow(fundingWindowSec, fundingIntervalSec): number

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

Intervals per calculation window — n. The per-interval divisor: each settlement accrues rate / n of the emitted per-window rate.

It is not a cap on what a lazily-settled emit accrues, and never treat it as one. The contract's catch-up horizon is ONE interval, so a settlement charges at most rate / n however long the gap was, and the excess is forgiven rather than deferred. Read FundingRateUpdate.intervalsAccrued for what a given settlement actually accrued; deriving it as min(intervalsSettled, n) is the specific error the protocol interface warns against, and it renders funding across intervals that were forgiven.

Parameters

fundingWindowSec

number

fundingIntervalSec

number

Returns

number