Sub topic 12
Funding rates
This chapter assumes you know what a perpetual swap is, how index and mark prices differ, and how margin works. It also assumes you can read short Python functions. Here you will learn how the funding rate is built, who pays whom, and what it costs to hold a position.
Why perpetuals need funding
A dated future converges to spot because it expires. A perpetual swap never expires, so nothing forces its price toward the spot index. The funding rate fills that gap. It is a periodic payment between longs and shorts that makes it costly to hold the side that is pushing the perpetual away from spot.
Funding is not a fee paid to the exchange. It moves between traders. The exchange only calculates it and settles it.
The basic rule
At each funding time, every open position pays or receives:
payment = position notional x funding rateNotional is quantity times mark price. The sign follows two rules:
- When the rate is positive, longs pay shorts.
- When the rate is negative, shorts pay longs.
Funding is charged on notional, not on margin. At 10x leverage, a 0.01% rate costs 0.1% of your margin per interval.
def funding_payment(qty, mark_price, funding_rate, side):
"""Positive result means the trader pays; negative means the trader receives."""
notional = qty * mark_price
payment = notional * funding_rate
return payment if side == "long" else -payment
print(funding_payment(1.0, 60000, 0.0001, "long"))
print(funding_payment(1.0, 60000, 0.0001, "short"))The long pays 6.0 USDT and the short receives 6.0 USDT. A trader who holds no position at the funding timestamp pays and receives nothing.
The feedback loop
Funding works as a price-correcting loop. If traders are mostly long, buying pressure pushes the perpetual above the index. The rate turns positive. Longs now pay shorts, which discourages new longs and rewards shorts. Arbitrageurs sell the perpetual and buy spot to collect the payments, and that pushes the perpetual back down.
The mirror case works the same way. When the perpetual trades below the index, the rate is negative, shorts pay longs, and the pressure reverses.
How the rate is calculated
Venues differ in the details, but most rates combine two parts:
- Premium component. How far the perpetual trades from the index, often measured with the mark price or an order-book average, as a fraction of the index.
- Interest component. A small fixed baseline, commonly 0.01% per 8 hours. It reflects the cost of borrowing one currency to hold the other.
A widely used design adds a clamp so that small premiums do not move the rate away from the baseline:
rate = premium + clamp(interest - premium, -band, +band)With a band of 0.05%, a premium close to zero gives a rate of about the interest rate. A large premium passes through almost unchanged.
def funding_rate(premium, interest=0.0001, band=0.0005):
"""Premium is (perp - index) / index. Rates are per funding interval."""
adjustment = max(-band, min(band, interest - premium))
return premium + adjustment
for p in (0.0, 0.0002, 0.002, -0.001):
print(p, funding_rate(p))The four outputs are about 0.0001, 0.0001, 0.0015, and -0.0005. In the third case, a 0.2% premium produces a 0.15% rate, because the clamp subtracts at most 0.05%.
Many venues also cap the rate per interval, for example at a multiple of the maintenance margin rate. The cap stops extreme premiums from producing payments large enough to trigger liquidations.
Intervals and annualizing
Many centralized venues settle every 8 hours (three times a day), though some use 4 hours or 1 hour. Some venues accrue funding continuously and settle it every second or minute. Always read the interval from the contract page. A rate of 0.01% means very different things at 8 hours and at 1 hour.
To compare rates across venues, annualize them:
def annualize(rate, intervals_per_day):
return rate * intervals_per_day * 365
print(annualize(0.0001, 3))This gives about 0.1095, or 10.95% a year. That figure is simple, not compounded. It also assumes the rate stays constant, and real rates do not.
Worked example
You are long 2 BTC perpetual at a mark price of 60,000 USDT. Funding is 0.03% per 8 hours.
- Notional: 2 x 60,000 = 120,000 USDT.
- Payment per interval: 120,000 x 0.0003 = 36 USDT.
- Per day: 3 x 36 = 108 USDT.
- Per day as a share of notional: 0.09%.
If you used 5x leverage, your margin is 24,000 USDT. Funding then costs 0.45% of margin per day. A price move of 0.5% in your favor would pay for roughly one day of funding. A sideways market can bleed a leveraged position without any price loss.
Edge cases and gotchas
- The mark price sets the notional. Funding uses the mark price at the funding time, not your entry price. A position that gains value pays more.
- Timing matters. Only positions open at the exact timestamp are charged. Opening a position one second after the timestamp avoids that interval's payment. Opening one second before incurs the whole payment. Traders tend to crowd around these times, which can add volatility.
- The published rate may be a prediction. Many venues display an estimated next rate that keeps changing until settlement. The rate that counts is the one fixed at the timestamp.
- Inverse contracts pay in the base coin. On an inverse contract, the payment is denominated in the coin, so its value in dollars changes with the price.
- Funding can reduce margin. A payment is debited from your balance. If your margin is thin, a funding payment can push you toward liquidation even when the price has not moved.
- Rates can stay one-sided for months. In strong bull markets, rates can stay positive for long stretches, and holding a leveraged long becomes an ongoing expense.
- Different venues, different rates. The same asset can have different funding on different venues. That gap is the basis for the funding trades in a later chapter.
Funding and the basis trade
Funding is what a trader earns when they hold the opposite side. If you hold spot and a short perpetual of equal size, price moves cancel. Your position is roughly market neutral, and you collect funding whenever the rate is positive. When the rate turns negative, you pay instead, so the trade can lose money. The next chapters on liquidation and basis trades build on this.
Exercise
You are short 0.5 BTC on a perpetual with a mark price of 80,000 USDT at the funding time. The funding rate is +0.02% per 8-hour interval. Does your position pay or receive, how much per interval, and what is the approximate annualized rate on notional (settled 3 times a day, not compounded)?
Show answer
The rate is positive, so longs pay shorts, and you are short, so you receive. Notional is 0.5 x 80,000 = 40,000 USDT. The payment is 40,000 x 0.0002 = 8 USDT per interval, or 24 USDT per day. The annualized rate on notional is 0.0002 x 3 x 365 = 0.219, about 21.9%. This holds only if the rate stays the same, and the short still carries full price risk unless it is hedged with spot.
Exercise
Using the clamp formula with interest = 0.01% and band = 0.05%, what is the funding rate when the premium is -0.08%?
Show answer
interest - premium = 0.0001 - (-0.0008) = 0.0009. The clamp limits this to 0.0005. The rate is -0.0008 + 0.0005 = -0.0003, or -0.03%. It is negative, so shorts pay longs, which pushes the perpetual back up toward the index.