Skip to content

Funding

Overview

Perpetual futures have no expiry date, so a periodic funding mechanism aligns the contract price with the underlying oracle price. Funding is settled hourly in a peer-to-peer fashion. When funding is positive, longs pay shorts; when it is negative, shorts pay longs.

Calculation

Premium Rate

Each minute, a premium rate is sampled from the orderbook. Impact bid and impact ask prices are computed by walking each side of the book until a configurable notional quantity (the impact quantity) is exhausted. The premium rate is then:

P=max(0,PimpactBidPoracle)max(0,PoraclePimpactAsk)PoracleP = \frac{\max(0, P_{\text{impactBid}} - P_{\text{oracle}}) - \max(0, P_{\text{oracle}} - P_{\text{impactAsk}})}{P_{\text{oracle}}}

Premium TWAP

Premium samples are accumulated into a time-weighted average price (TWAP) over the one-hour funding period.

TWAP=iPiwiiwi\text{TWAP} = \frac{\sum_{i} P_i \cdot w_i}{\sum_{i} w_i}

Funding Rate

At the top of each hour, the funding rate is derived from the premium TWAP. The TWAP is dampened by a factor of 8, a base rate of 0.01% is added, and the result is clamped:

F=clamp(TWAP8+0.0001,0.05,0.05)F = \text{clamp}\left(\frac{\text{TWAP}}{8} + 0.0001, -0.05, 0.05\right)

The dampening factor distributes the hourly premium signal across an 8-hour window, smoothing funding costs for participants. The base rate introduces a small bias toward longs paying shorts, reflecting the cost-of-carry of the underlying asset.

Note: Funding is capped at 5% in either direction, as per the clamp in the above formula.

Funding Payment

Each account's funding payment per period is:

Funding=positionSize×Poracle×F\text{Funding} = \text{positionSize} \times P_{\text{oracle}} \times F

A positive funding rate means longs pay shorts; a negative rate means shorts pay longs.