For the complete documentation index, see llms.txt. This page is also available as Markdown.

Funding Rate

Perpetual futures never expire, so a periodic cash transfer between longs and shorts — funding — anchors the contract's price to the oracle (spot) price. During each funding interval the Exchange samples the instantaneous premium index (PrefPoracle)/Poracle(P_{ref} - P_{oracle})/P_{oracle} — the perpetual's own traded price against the oracle, not the mark (F.1) — and accumulates it weighted by the time elapsed since the previous sample. At any point in the interval the rate is the time-weighted average premium plus a fixed interest component, pro-rated from an 8-hour quote convention to the actual settlement window and clamped to a symmetric cap ±c\pm c (F.3). At settlement, each position pays or receives an amount proportional to its notional value at the oracle price (F.4): with a positive rate, longs pay shorts; with a negative rate, shorts pay longs. The construction is exactly zero-sum between matched long and short open interest.

The funding rate is a fan-in of the premium accumulator and the interval clock, and settlement feeds back both into a fresh accumulator and into the positioning pressure that moves the next premium.

The funding rate is a fan-in of the premium accumulator and the interval clock, and settlement feeds back both into a fresh accumulator and into the positioning pressure that moves the next premium.

Setting

Symbol
Name
Description
Units
Domain

PoracleP_{oracle}

oracle_price

External index (oracle) price of the underlying asset. Samples with a non-positive oracle price are skipped by the implementation, so the effective domain is strictly positive.

USDX per unit of asset

(0, ∞)

PrefP_{ref}

perp_reference_price

The perpetual's own traded price on the Exchange's book — the volume-weighted median of the recent-trade window (O.7). This is the perp side of the premium index. OracleValidator::trade_reference_price returns the last trade price when the window is empty, and None when that is also unset — a market that has never traded, or one whose trade history and last trade price were both just cleared by a large oracle re-anchor (OracleValidator::accept_trusted) — at which point the oracle commit path substitutes PoracleP_{oracle} (commit_oracle_and_sample_funding); there is no time-based staleness check on the window otherwise, so on a market that traded a few times and then went quiet without a re-anchor, PrefP_{ref} keeps reflecting those trades — however old — until enough new trades displace them.

USDX per unit of asset

(0, ∞)

PmarkP_{mark}

mark_price

The Exchange's mark price, wPoracle+(1w)Prefw \cdot P_{oracle} + (1-w) \cdot P_{ref}. Drives margin and liquidation — but NOT the premium index (see F.1) or the settlement notional, which is struck at PoracleP_{oracle} (see F.4).

USDX per unit of asset

(0, ∞)

ii

interest_8h

Fixed interest component of the rate quote — the value the average premium is pulled toward, bounded by bb (F.3). 0.00010.0001 (0.01% per 8h).

dimensionless (per 8h)

fixed

bb

interest_pull_clamp_8h

How far the interest term may pull the average premium toward itself, per 8 hours (F.3). Matches Binance, Hyperliquid, Aster, EVEDEX and Lighter. 0.00050.0005 (0.05% per 8h).

dimensionless (per 8h)

fixed

WW

window_secs

Length of one funding settlement window. Hourly in production (3600).

seconds

(0, ∞)

Δt\Delta t

time_delta_secs

Seconds elapsed since the previous sample in the interval. Samples at or before the previous sample time are ignored, so the effective domain is strictly positive. Derived in code from millisecond timestamps divided by 1000.

seconds

(0, ∞)

AA

accumulated_premium

Running sum of premium-index samples weighted by their time deltas, ipiΔti\sum_i p_i \, \Delta t_i, over the current funding interval. Reset to zero at each interval boundary.

dimensionless-seconds (premium × seconds)

unbounded

TT

total_time_secs

Total elapsed time in the current interval, from the interval start to the most recent sample. Derived, not stored: when zero (no samples yet) the implementation short-circuits and returns a zero rate rather than dividing.

seconds

(0, ∞)

cc

funding_rate_cap

Per-market symmetric cap on the funding rate, stored in market parameters. Two configured values: 0.0010.001 (0.1% per settlement window) on the crypto perps, 0.00050.0005 on the FX, commodity, and index perps. Which markets in each class are actually deployed changes with the venue's rollout state — see Market Specifications for the live per-market set rather than a fixed snapshot here.

dimensionless (fraction per funding interval)

(0, ∞)

ff

funding_rate

The clamped funding rate applied to positions at settlement; always lies in [c,+c][-c, +c].

dimensionless (fraction per funding interval)

[-c, +c]

SS

size

Absolute position size in units of the underlying asset (always non-negative; direction is carried separately by the position side).

units of asset

[0, ∞)

σ\sigma

side_sign

Direction indicator for the position: +1+1 for a long position, 1-1 for a short position. Encodes the match on position side in the implementation.

dimensionless

[-1, 1]

The mechanism

Premium Index Sampling

Each oracle tick produces one sample of the instantaneous premium index: the relative deviation of the perpetual's own traded price from the oracle price.

The numerator is PrefP_{ref}, not PmarkP_{mark}, and the distinction is load-bearing. Since Pmark=wPoracle+(1w)PrefP_{mark} = w \cdot P_{oracle} + (1-w) \cdot P_{ref}, substituting the mark would give (PmarkPoracle)/Poracle=(1w)(PrefPoracle)/Poracle(P_{mark} - P_{oracle})/P_{oracle} = (1-w) \cdot (P_{ref} - P_{oracle})/P_{oracle} — the true premium scaled by (1w)(1-w), i.e. 5% of it at the production w=0.95w = 0.95, with a damping factor that moves silently whenever a margin parameter is retuned. The premium is defined against the traded price so that it measures the deviation it is named for. A positive premium means the perpetual trades rich to the index (longs are crowded); a negative premium means it trades cheap. The implementation skips any sample whose oracle price is not strictly positive, leaving the interval state unchanged, so the division is always well defined.

p=PrefPoraclePoracle(F.1)p = \frac{P_{ref} - P_{oracle}}{P_{oracle}} \tag{F.1}

Samples arrive at an irregular cadence, so each premium index (F.1) is weighted by the time elapsed since the previous sample before being added to the interval accumulator AA. This makes the accumulator the exact time integral of the (piecewise-constant) premium index over the interval, independent of sampling frequency: 1-minute and 5-second cadences produce identical averages for the same premium path. Samples with a timestamp at or before the previous sample time are ignored, so Δt\Delta t is strictly positive.

AA+pΔt(F.2)A \leftarrow A + p \cdot \Delta t \tag{F.2}

Funding Rate

The funding rate is built in four steps: the time-weighted average premium (the accumulator (F.2) divided by total elapsed time TT); a bounded pull toward the fixed interest component ii, capped at ±b\pm b rather than added unconditionally; pro-rating that 8-hour-basis quote to the actual settlement window WW; and finally clamping to the symmetric per-market cap ±c\pm c.

The inner clamp (ENG-13673, matching Binance, Hyperliquid, Aster, EVEDEX and Lighter) makes the interest term a bounded pull toward ii, not an unconditional addition: when A/TA/T is within bb of ii, the rate rests exactly at ii; when it is further away, the interest term contributes at most ±b\pm b rather than the full ii. The quote convention still matters: the whole bracket is a per-8-hour rate, the industry standard, and the amount charged at an hourly boundary is that rate scaled by W/28800W / 28800. The outer clamp is applied last, to the pro-rated value, so cc bounds the wealth transfer per settlement window regardless of how dislocated the perpetual becomes. When no time has elapsed in the interval (T=0T = 0, i.e. no samples yet), the implementation returns zero rather than dividing by zero. The predicted funding rate published mid-interval is defined to be this same value: the current average is the best estimate of the final rate.

f=clamp ⁣((AT+clamp ⁣(iAT,  b,  +b))W28800,  c,  +c)(F.3)f = \operatorname{clamp}\!\left(\left(\frac{A}{T} + \operatorname{clamp}\!\left(i - \frac{A}{T},\; -b,\; +b\right)\right) \cdot \frac{W}{28800},\; -c,\; +c\right) \tag{F.3}

Because the outer clamp binds on the composed quantity, and the inner clamp already caps the interest term's contribution at ±b\pm b once A/TA/T is far from ii, the basis at which the outer clamp engages is 8c+b8c + b: at the production c=0.001c = 0.001, b=0.0005b = 0.0005 that is a 0.85% basis, not 0.1%.

Funding Payments

At settlement each open position exchanges cash proportional to its notional value at the oracle price. The signed amount is the position's notional SPoracleS \cdot P_{oracle} times the funding rate (F.3), with the sign flipped for shorts via σ\sigma. The convention is: a positive amount means the account pays; a negative amount means the account receives. So with a positive rate (f>0f > 0, perpetual rich to index) longs pay and shorts receive, and with a negative rate shorts pay and longs receive. For equal long and short size at the same rate, the two amounts cancel exactly.

The notional is struck at PoracleP_{oracle} rather than PmarkP_{mark} so that both sides of a matched pair are valued on the same external anchor — the two counterparties must exchange identical magnitudes, and the oracle is the price neither side's own trading can move.

Π=σSPoraclef(F.4)\Pi = \sigma \cdot S \cdot P_{oracle} \cdot f \tag{F.4}

Invariants

  • The funding rate is always bounded: cf+c-c \le f \le +c for every interval state ((F.3)).

  • Zero premium implies a rate of exactly the pro-rated interest: if Pref=PoracleP_{ref} = P_{oracle} for the whole interval, then A=0A = 0, iA/T=ii - A/T = i is within ±b\pm b so the inner clamp passes it through unchanged, and f=iW/28800f = i \cdot W/28800. (Earlier revisions of this model omitted the interest term and read this as a zero rate; the interest term makes the resting rate non-zero.)

  • The rate rests exactly at the pro-rated interest rate for a whole band of premiums, not only at zero: whenever A/Tib|A/T - i| \le b the inner clamp passes iA/Ti - A/T through unchanged, so f=iW/28800f = i \cdot W/28800 regardless of the exact premium within that band (ENG-13673). Outside the band, ff tracks A/TA/T almost 1:1, offset by at most ±b\pm b, but only below the band: above it (A/T>i+bA/T > i + b) the inner clamp saturates at b-b, so f=(A/Tb)W/28800f = (A/T - b) \cdot W/28800, which is always positive there since A/T>i+b>bA/T > i + b > b. Below the band (A/T<ibA/T < i - b) the inner clamp saturates at +b+b, so f=(A/T+b)W/28800f = (A/T + b) \cdot W/28800, and f<0f < 0 needs A/T<bA/T < -b — not A/T<ibA/T < i - b, which only marks where the inner clamp starts saturating, not where the sign flips. At A/T=0.00045A/T = -0.00045 (inside ib=0.0004i - b = -0.0004's neighborhood but above b=0.0005-b = -0.0005) the inner clamp saturates at +b+b and ff comes back +0.00005W/28800+0.00005 \cdot W/28800, still positive.

  • Funding is exactly zero-sum for matched open interest: for equal long and short size at the same oracle price and rate, Πlong+Πshort=0\Pi_{long} + \Pi_{short} = 0 ((F.4)); verified by property-based testing across the full rate range.

  • Payments are linear in position size: tripling SS triples Π\Pi exactly.

  • The rate is well defined at all times: with no samples in the interval (T=0T = 0) the rate is exactly 00, never a division error.

  • Samples with non-positive oracle price or non-increasing timestamps leave the interval state unchanged.

  • The TWAP is sampling-cadence invariant for a constant premium: any positive sampling frequency yields the same ff for a given premium pp, equal to (p+clamp(ip,b,+b))W/28800\left(p + \operatorname{clamp}(i - p,\, -b,\, +b)\right) \cdot W/28800 (when below the outer cap) — not to pp itself, since the bounded interest pull and the window pro-rating both apply.

Worked example

Consider the BTC perpetual with the oracle steady at Poracle=50,000P_{oracle} = 50{,}000, observed over 8 hours of premium accumulation. For the first 4 hours the perp reference is 50,02050{,}020, a premium index of p1=20/50,000=0.0004p_1 = 20/50{,}000 = 0.0004 per (F.1); for the last 4 hours it is 50,03550{,}035, so p2=35/50,000=0.0007p_2 = 35/50{,}000 = 0.0007. Sampling once per minute, each phase contributes its premium times its duration to the accumulator per (F.2): A=0.0004×14,400+0.0007×14,400=5.76+10.08=15.84A = 0.0004 \times 14{,}400 + 0.0007 \times 14{,}400 = 5.76 + 10.08 = 15.84 premium-seconds.

Over T=28,800T = 28{,}800 seconds the raw time-weighted average premium is A/T=15.84/28,800=0.00055A/T = 15.84 / 28{,}800 = 0.00055 — exactly the duration-weighted mean of the two phases, (0.0004+0.0007)/2(0.0004 + 0.0007)/2. The interest pull is clamp(0.00010.00055,0.0005,+0.0005)=clamp(0.00045,±0.0005)=0.00045\operatorname{clamp}(0.0001 - 0.00055,\, -0.0005,\, +0.0005) = \operatorname{clamp}(-0.00045,\, \pm 0.0005) = -0.00045 — inside the ±b\pm b band, so it passes through unclamped — giving an 8-hour quote of 0.00055+(0.00045)=0.00010.00055 + (-0.00045) = 0.0001, exactly the interest rate.

Production settles hourly, so per (F.3) the rate actually charged at a boundary is that quote pro-rated: f=0.0001×3600/28800=0.0000125f = 0.0001 \times 3600/28800 = 0.0000125. With a cap of c=0.001c = 0.001 this is far inside the band, so the outer clamp does not bind.

Now settle a 2 BTC long. Its notional is 2×50,000=100,0002 \times 50{,}000 = 100{,}000 USDX, so per (F.4) the payment is Π=+1×100,000×0.0000125=1.25\Pi = +1 \times 100{,}000 \times 0.0000125 = 1.25 USDX — positive, so the long pays. A 2 BTC short of the same size has Π=1.25\Pi = -1.25 USDX and receives the same amount: the transfer is exactly zero-sum.

Had the perpetual instead sustained a 10% premium, the interest pull would saturate at b=0.0005-b = -0.0005 (since 0.00010.100.0001 - 0.10 is far outside ±0.0005\pm 0.0005), giving an 8-hour quote of 0.100.0005=0.09950.10 - 0.0005 = 0.0995, which would pro-rate to 0.01243750.0124375 and be clamped to c=0.001c = 0.001, so every position would settle at the cap. Note where that boundary sits: the outer clamp engages at a basis of 8c+b=0.00858c + b = 0.0085, i.e. 0.85%, not at 0.1%.

Analysis

Stale relative to the model above. The Sensitivity, Response curves, and Parameter space sections below are machine-generated by the math-engine pipeline (eng/ops/intelligence/math-engine, owned by the Modeling & Security pod) from an earlier revision of this model — they still elasticize/plot against mark_price rather than perp_reference_price/oracle_price, and the surfaces still hold the cap at ±0.0075 (0.75%) rather than the production 0.001 (0.1%) discussed above. Regenerating them requires that pipeline to re-derive the model from the current Rust source, which is out of scope for this doc-alignment pass; flagging here rather than hand-editing generated output or silently leaving it uncaveated.

Sensitivity

Elasticities ε = (∂y/∂x)·(x/y), computed numerically from the verified expressions at each worked-example point. |ε| > 1 means the output moves more than proportionally with that input.

Expression
Input
Elasticity ε

premium_index

mark_price

1.43e+03

premium_index

oracle_price

-1.43e+03

sample_contribution

mark_price

1.43e+03

sample_contribution

oracle_price

-1.43e+03

sample_contribution

time_delta_secs

1

funding_rate

accumulated_premium

1

funding_rate

total_time_secs

-1

funding_rate

funding_rate_cap

0

funding_payment

side_sign

1

funding_payment

size

1

funding_payment

mark_price

1

funding_payment

funding_rate

1

Sensitivity tornado — Premium index
Sensitivity tornado — Funding rate (clamped TWAP)
Sensitivity tornado — Funding payment

Response curves

The instantaneous premium index is linear in the mark price and crosses zero exactly where mark equals the fixed $50,000 oracle price.

The instantaneous premium index is linear in the mark price and crosses zero exactly where mark equals the fixed $50,000 oracle price.

Over a full 8-hour interval (T = 28,800 s) the funding rate rises linearly with the accumulated premium until the average hits the ±0.0075 cap, where it saturates.

Over a full 8-hour interval (T = 28,800 s) the funding rate rises linearly with the accumulated premium until the average hits the ±0.0075 cap, where it saturates.

At a positive 0.05% rate and $50,000 mark price, payments scale linearly with size and are exactly mirrored between long and short, so matched open interest nets to zero.

At a positive 0.05% rate and $50,000 mark price, payments scale linearly with size and are exactly mirrored between long and short, so matched open interest nets to zero.

Parameter space

Joint parameter effects evaluated from the verified expressions over 2-D grids.

The clamp carves wedge-shaped saturation zones where |accumulated premium / time| exceeds the ±0.75% cap, so short accumulation windows saturate at far smaller premiums; cap held at 0.0075.

The clamp carves wedge-shaped saturation zones where |accumulated premium / time| exceeds the ±0.75% cap, so short accumulation windows saturate at far smaller premiums; cap held at 0.0075.

The bilinear size × rate interaction produces hyperbolic level sets of equal payment, with the sign flip at rate = 0 splitting payers from receivers; mark price held at 50,000 for a long position.

The bilinear size × rate interaction produces hyperbolic level sets of equal payment, with the sign flip at rate = 0 splitting payers from receivers; mark price held at 50,000 for a long position.

References

  • Derived from and adversarially verified against the Exchange's Rust implementation and its test suite.

  • Sibling model: insurance-fund

  • Sibling model: liquidation-engine

  • Sibling model: margin-math

  • Sibling model: oracle

  • Sibling model: order-book

  • Sibling model: position-tracker

  • Sibling model: settlement

Last updated