Skip to main content

Overview

Funding payments anchor perpetual contract prices to spot. They are exchanged hourly, directly between long and short holders. The exchange does not take a cut. If the perp trades at a premium to spot, longs pay shorts. If at a discount, shorts pay longs.

Funding Rate Formula

Each funding period, the rate is computed from sampled premiums: F=clamp(Pμ+clamp(r−Pμ,−d,d),−fcap,fcap)F = \text{clamp}\left(P_\mu + \text{clamp}(r - P_\mu, -d, d), -f_{\text{cap}}, f_{\text{cap}}\right) Where:

Premium Sampling

Each sample interval (configurable, typically every few seconds):
  1. Compute the depth-weighted bid and ask prices by sweeping a fixed notional amount through the book:
    • P_bid = sweep(sell, size)
    • P_ask = sweep(buy, size)
    • where size = notional / mid
  2. Get the oracle price P_o
  3. Compute the premium:
ΔD=max⁡(Pbid−Po,0)−max⁡(Po−Pask,0)\Delta D = \max(P_{\text{bid}} - P_o, 0) - \max(P_o - P_{\text{ask}}, 0) Π=ΔDPo\Pi = \frac{\Delta D}{P_o}
  1. P_mu = SMA(Pi) over the configured window
This depth-weighted premium is more robust than a simple mid-price comparison because it accounts for actual executable prices at meaningful size.

Funding Payment

For each position at funding time: payment=notionalUSD×F×(−sign(Q))\text{payment} = \text{notional}_{\text{USD}} \times F \times (-\text{sign}(Q))
  • Long (Q > 0) with positive F: pays funding (payment deducted from margin)
  • Short (Q < 0) with positive F: receives funding (payment added to margin)
  • Signs reverse when F is negative
Payments are applied directly to your margin balance. No separate funding wallet.

Schedule

Funding is calculated and settled every hour, aligned to the top of the hour. The rate is applied to positions open at the funding timestamp.