Funding rates are the mechanism by which perpetual contract prices converge to the underlying index price. Payments flow between long and short traders based on the spread between mark and index prices.
Calculation
The funding rate is computed in basis points (bps) using the formula:
The negation ensures longs pay when the rate is positive (mark above index).
State Updates
On each funding application:
collateral balances adjusted by payment amount
realized_pnl updated on each position
Market state records:
last_funding_tick — prevents duplicate payments
cumulative_funding_bps — running total for historical reference
Updated mark_price and index_price
Zero-Sum Property
Funding is always zero-sum between counterparties. The system does not create or destroy value through funding—it only transfers between longs and shorts.