@somnia-chain/markets-sdk / index / FundingRateCandle
Type Alias: FundingRateCandle
FundingRateCandle =
object
Defined in: packages/sdk/src/perp/history.ts:330
A funding-rate rollup bucket (mirror of the indexer FundingRateCandle) — for
charting ranges the raw series is too dense for.
Each bucket is built by distributing every settlement across the buckets its covered span overlaps, weighted by seconds and normalized to a fixed per-8h axis. That is not an implementation detail: crediting a lazily-settled emit to the bucket containing its log renders a phantom spike of however many intervals it accrued, while the buckets the funding actually applied to render as paused. At the live hourly cadence an hourly bucket holds exactly ONE interval, so even a two-interval emit doubles one bucket and empties its neighbour.
Properties
id
id:
string
Defined in: packages/sdk/src/perp/history.ts:332
Bucket id (${pool}_${intervalSeconds}_${bucketStart}).
pool
pool:
string
Defined in: packages/sdk/src/perp/history.ts:333
intervalSeconds
intervalSeconds:
number
Defined in: packages/sdk/src/perp/history.ts:335
3600 | 14400 | 86400.
bucketStart
bucketStart:
string
Defined in: packages/sdk/src/perp/history.ts:337
Bucket start (unix seconds).
avgFundingRate8h
avgFundingRate8h:
string
Defined in: packages/sdk/src/perp/history.ts:344
Seconds-weighted mean rate, already on a per-8h basis, and zero-filled: seconds no
settlement covered pull the mean toward zero rather than being dropped. So a
partially covered bucket reads BELOW the rate that was in force — read coverage to
tell that apart from a genuinely small rate.
minFundingRate8h
minFundingRate8h:
string|null
Defined in: packages/sdk/src/perp/history.ts:350
Extremes over CONTRIBUTING settlements only — undiluted by coverage and NOT
zero-filled, so they can legitimately sit outside avgFundingRate8h on a thinly
covered bucket. Null when no settlement's span reached this bucket.
maxFundingRate8h
maxFundingRate8h:
string|null
Defined in: packages/sdk/src/perp/history.ts:351
coverage
coverage:
string
Defined in: packages/sdk/src/perp/history.ts:357
Covered seconds / bucket seconds, 1e18-scaled — a true ratio in [0, 1]. This is what
a chart should hatch or grey on: a bucket at avgFundingRate8h: 0 with low coverage
is a PAUSE, not a measurement of zero funding.
cumulativeFundingStart
cumulativeFundingStart:
string
Defined in: packages/sdk/src/perp/history.ts:375
Cumulative funding index at this bucket's wall-clock START and END, attributed by
covered seconds — the same basis as avgFundingRate8h.
Two exact properties follow, and both are what this pair is for:
- Sparse buckets telescope.
cumulativeFundingEndequals the next existing bucket'scumulativeFundingStart, even across a gap no settlement covered — the index is flat over uncovered time, so there is nothing to attribute. - Range sums are exact.
sum(end - start)over any set of buckets is the funding that accrued over them; see realizedFundingPerBase.
These are ATTRIBUTION values, not chain samples. A catch-up settlement's whole span is
spread across the buckets it covered rather than booked at its log, so an interior
edge deliberately will NOT equal any FundingRateUpdate.cumulativeFundingPerUnit.
Use client.listFundingRateHistory when you want the sampled series itself.
cumulativeFundingEnd
cumulativeFundingEnd:
string
Defined in: packages/sdk/src/perp/history.ts:376
fundingWindowSec
fundingWindowSec:
number
Defined in: packages/sdk/src/perp/history.ts:378
Params at the bucket's last settlement; paramsChangedInBucket flags a mid-bucket change.
fundingIntervalSec
fundingIntervalSec:
number
Defined in: packages/sdk/src/perp/history.ts:379
paramsChangedInBucket
paramsChangedInBucket:
boolean
Defined in: packages/sdk/src/perp/history.ts:380
indexPriceEnd
indexPriceEnd:
string|null
Defined in: packages/sdk/src/perp/history.ts:381
openInterestEnd
openInterestEnd:
string|null
Defined in: packages/sdk/src/perp/history.ts:382
updateCount
updateCount:
number
Defined in: packages/sdk/src/perp/history.ts:384
How many settlements contributed to this bucket.