Sub topic 8
Funding rates and the cost of holding a leveraged position
This chapter assumes you already know what a perpetual futures contract is, how margin and leverage work, and how to read short Python functions. It covers the recurring payment between longs and shorts that keeps a perpetual's price near the spot price, how to compute it, and how it affects the cost of a leveraged position.
Why perpetuals need a funding rate
A dated futures contract expires on a fixed day. At expiry its price must equal the spot price, so the two prices converge. A perpetual futures contract never expires, so nothing forces that convergence. Exchanges need another mechanism to keep the perpetual price (the "perp price") close to the underlying spot or index price.
That mechanism is the funding rate. It is a periodic payment exchanged directly between traders:
- When the funding rate is positive, longs pay shorts.
- When the funding rate is negative, shorts pay longs.
The exchange does not keep this payment (apart from small implementation details that vary by venue). It moves money from one side of the market to the other.
The incentive works like this. If the perp trades above the index, longs are crowding in and pushing the price up. A positive funding rate makes holding a long more expensive and holding a short profitable. That draws in short sellers and encourages longs to close, which pushes the perp price back toward the index. A negative rate does the reverse when the perp trades below the index.
The structure of a funding payment
Most exchanges build the funding rate from two parts:
- Premium (or basis). The gap between the perp price and the index price, expressed as a fraction of the index price.
- Interest component. A fixed baseline rate that reflects the difference in borrowing cost between the quote currency (such as USD) and the base asset. Many venues set this to a small constant, for example 0.01% per 8 hours.
A common simplified form is:
funding_rate = premium + clamp(interest - premium, -0.05%, +0.05%)The clamp keeps the interest term from pushing the rate too far when the premium is small. Exact formulas, sampling windows and caps differ between exchanges, so always read the contract specification of the venue you use.
The payment a trader actually makes or receives at each funding time is:
payment = position_value * funding_rateHere position_value is the notional size of the position (size times mark price), not the margin. This detail matters: the payment is charged on the whole leveraged position, even though you only deposited a fraction of it.
Funding intervals
Many venues settle funding every 8 hours, which gives three payments per day. Some use 4-hour or 1-hour intervals, and some accrue funding continuously and settle it more often. The rate is usually quoted per interval, so you must know the interval before you compare rates across exchanges.
Only traders who hold a position at the moment of settlement pay or receive funding. If you open a position after one settlement and close it before the next, you pay nothing.
Worked example: the cost of carrying a long
Suppose you open a long on a perpetual with these terms:
- Margin: 1,000 USDT
- Leverage: 10x
- Position value: 10,000 USDT
- Funding rate: +0.01% per 8 hours (a common baseline)
Each payment is 10,000 × 0.0001 = 1 USDT. Over a day with three settlements, that is 3 USDT, or 0.3% of your margin. Over a year it is about 1,095 USDT, or 109.5% of your margin.
Notice what this means. The headline rate looks tiny, but it is charged on the leveraged notional and compounds against a much smaller margin base. Leverage multiplies funding cost in the same way it multiplies profit and loss.
The next code block turns this into a function. It reports the funding cost as a fraction of margin and as an annualised figure.
def funding_cost(position_value, margin, rate_per_interval, intervals_per_day, days):
"""Funding paid by a position that is held across every settlement.
A positive result is a cost to a long (and income to a short) when the
rate is positive. Ignores compounding and changes in the rate.
"""
payments = intervals_per_day * days
total = position_value * rate_per_interval * payments
return total, total / margin
def annualised_rate(rate_per_interval, intervals_per_day):
"""Simple (non-compounded) annual rate implied by a per-interval funding rate."""
return rate_per_interval * intervals_per_day * 365
total, share_of_margin = funding_cost(
position_value=10_000,
margin=1_000,
rate_per_interval=0.0001,
intervals_per_day=3,
days=30,
)
print(f"30 days: {total:.2f} USDT, {share_of_margin:.1%} of margin")
print(f"Annualised funding rate: {annualised_rate(0.0001, 3):.2%}")Running it prints 90.00 USDT over 30 days, which is 9.0% of margin, and an annualised funding rate of 10.95%. The annualised rate applies to the notional. Because the notional is ten times the margin, the burden on your own capital is ten times larger.
Funding as a sentiment signal
Funding rates reflect which side is more eager to hold a position. That makes them useful as a gauge of positioning:
| Funding rate | What it usually means | What to watch for |
|---|---|---|
| Near the baseline (about +0.01% per 8 hours) | Mildly bullish, balanced market | Normal conditions |
| Strongly positive | Longs are paying a premium to stay in; leveraged long demand is high | Crowded longs; a drop can trigger long liquidations |
| Near zero or slightly negative | Weak long demand or rising short interest | Neutral to cautious sentiment |
| Strongly negative | Shorts are paying to stay in; leveraged short demand is high | Crowded shorts; a rally can trigger a short squeeze |
Extreme funding does not predict the direction of the next move by itself. It tells you that one side is paying heavily to hold its position and that its positions are likely to be leveraged. When the price moves against that crowded side, forced liquidations follow. Chapter material on open interest and liquidation cascades builds on this signal.
How funding interacts with liquidation
Funding is paid from or credited to your margin balance, so it changes your equity over time. For a long paying positive funding:
- Your margin balance shrinks a little at each settlement.
- The gap between your equity and the maintenance requirement narrows.
- Your liquidation price moves closer to the current price, even if the market does not move.
In the liquidation-price function from the earlier chapter, fees and funding were ignored. In practice, a position that sits flat for weeks while paying funding can be liquidated by funding alone if the margin is thin.
This code estimates how many settlements a flat position can survive before funding alone brings equity down to the maintenance requirement.
def settlements_until_liquidation(margin, position_value, maintenance_rate, rate_per_interval):
"""Number of funding settlements a flat-priced long can survive.
Equity falls by position_value * rate each settlement. Liquidation
occurs when equity reaches maintenance_rate * position_value.
Returns None if the rate is zero or negative (the long is not paying).
"""
if rate_per_interval <= 0:
return None
buffer = margin - maintenance_rate * position_value
if buffer <= 0:
return 0
per_settlement = position_value * rate_per_interval
return int(buffer // per_settlement)
# 10x long, 0.5% maintenance rate, funding at 0.01% per 8 hours
print(settlements_until_liquidation(1_000, 10_000, 0.005, 0.0001)) # 950
# Same position during a euphoric spell, funding at 0.1% per 8 hours
print(settlements_until_liquidation(1_000, 10_000, 0.005, 0.001)) # 95At the baseline rate the position survives 950 settlements, which is about 316 days. At ten times the rate it survives 95 settlements, about 32 days. Real positions also face price moves, so the actual margin of safety is much smaller. The point is that high funding steadily erodes the buffer you rely on.
Funding for the short side and for hedgers
A short position receives funding when the rate is positive. This creates a well-known strategy called a cash-and-carry or basis trade. A trader buys the spot asset and shorts an equal notional amount of the perpetual. The two legs cancel each other's price exposure. The trader collects positive funding as income, while still bearing exchange risk, margin management on the short leg, and the chance that the funding rate turns negative.
This activity matters for the whole market. Basis traders supply short-side demand when funding is high, which dampens extreme premiums. It also means that part of the open interest in a perp market is hedged and not directional, which weakens the link between open interest and crowded one-way bets.
Common errors and edge cases
- Confusing the per-interval rate with the daily or annual rate. A rate of 0.01% per 8 hours is 0.03% per day, not 0.01% per day.
- Applying the rate to margin instead of notional. Funding is charged on position value. A 20x position pays twenty times the funding of the same margin unleveraged.
- Ignoring the sign. A positive rate means longs pay. A short in a positive-funding market earns money. A long in a negative-funding market earns money.
- Assuming the rate is fixed. The rate you see is often a prediction for the next settlement. The value actually charged is set from the premium measured over the interval, and it can change sharply.
- Forgetting the settlement timestamp. A position closed one minute before settlement pays nothing. A position opened one minute before settlement pays a full interval's funding.
- Comparing venues without normalising intervals. Convert every rate to the same period, such as a daily or annualised figure, before comparing.
- Treating funding as the only holding cost. Trading fees, spread, and slippage on entry and exit add to the total cost of a leveraged trade.
Summary of the key relationships
- Funding is a transfer between longs and shorts, set by the gap between the perp and index prices plus a small interest term.
- The payment equals position value times the rate, so leverage multiplies its effect on your margin.
- Positive funding costs longs and pays shorts. Negative funding does the reverse.
- Extreme funding is a sign of crowded, usually leveraged positioning.
- Funding reduces equity over time and moves your liquidation price toward the market.
Exercise
You hold a 5x long worth 20,000 USDT of notional on a perpetual. Funding settles every 8 hours at +0.02% per interval. (a) How much do you pay per settlement? (b) How much do you pay over 10 days, and what share of your margin is that? (c) What is the annualised funding rate on the notional?
Show answer
(a) Position value is 20,000 USDT, so each payment is 20,000 × 0.0002 = 4 USDT. (b) There are 3 settlements per day, so 30 settlements over 10 days. The total is 30 × 4 = 120 USDT. Margin is 20,000 / 5 = 4,000 USDT, so funding is 120 / 4,000 = 3.0% of margin. (c) The annualised rate is 0.0002 × 3 × 365 = 0.219, or 21.9% on the notional.
Exercise
The perpetual for an asset has traded at a funding rate of +0.08% per 8 hours for several days, much higher than the 0.01% baseline. Name two things this suggests about the market, and one risk it creates for a trader who holds a leveraged long.
Show answer
It suggests that demand for leveraged long positions is strong and that the perp trades at a premium to the index. It also suggests that many longs are likely to be leveraged, so the market is crowded on one side. The risk for a leveraged long is that high funding steadily drains margin and moves the liquidation price closer, and that a price drop can set off forced selling from other crowded longs.