Sub topic 15
Basis and funding trades
This chapter assumes you know how spot markets and order books work and how a dated future converges to spot at expiry. It also assumes you know how perpetual swaps use funding payments and how margin and liquidation work. You also need basic Python.
The idea: hold both sides, keep the spread
A basis or funding trade holds a long position in one market and an equal short position in a related market. Price moves in the underlying asset cancel out. What remains is the gap between the two prices (the basis) or the periodic funding payment. Traders call this position delta-neutral. Delta is the sensitivity of a position's value to the asset's price, so a delta of zero means a price move does not change your net value.
There are two common forms:
- Cash-and-carry: buy spot and short a dated future. You earn the basis as the future converges to spot at expiry.
- Funding trade: buy spot and short a perpetual swap. You earn funding payments while the funding rate is positive.
The trade is attractive because the return does not depend on guessing direction. It is not risk-free, and most of this chapter covers why.
Cash-and-carry on a dated future
Suppose spot BTC is 60,000 and the 90-day future trades at 61,500. This is contango, a future priced above spot. The premium is 2.5% over 90 days. Annualized, it is:
def annualized_basis(spot, futures, days_to_expiry):
return (futures / spot - 1) * 365 / days_to_expiry
print(round(annualized_basis(60000, 61500, 90), 4))This prints 0.1014, about 10.1% per year. That figure is the gross, simple (non-compounded) rate. You lock in the 1,500 premium by buying 1 BTC spot and shorting 1 BTC of the future. At expiry the future settles to the index price, which is close to spot, so the short leg gains whatever the spot leg does not.
The next function computes net profit including fees, whatever the settlement price turns out to be:
def carry_pnl(qty, spot_entry, fut_entry, settle,
spot_fee=0.001, fut_fee=0.0005):
spot_leg = qty * (settle - spot_entry)
fut_leg = qty * (fut_entry - settle)
fees = (qty * spot_entry * spot_fee
+ qty * fut_entry * fut_fee
+ qty * settle * spot_fee)
return spot_leg + fut_leg - fees
for settle in (60000, 70000):
print(settle, round(carry_pnl(1, 60000, 61500, settle), 2))
net = carry_pnl(1, 60000, 61500, 60000)
capital = 60000 + 0.10 * 61500 # spot cost plus 10% margin on the short
print(round(net / capital * 365 / 90, 4))The output is 60000 1349.25, 70000 1339.25, and 0.0827. The profit barely changes between the two settlement prices, which shows the hedge works. The only difference is the fee on the final spot sale. The return on total capital is 8.3%, below the 10.1% gross basis. Two things cause this: fees, and the margin you must lock up on the short leg in addition to the spot purchase.
Funding trade on a perpetual swap
A perpetual has no expiry, so there is no convergence date. Funding keeps it near the index price. When the rate is positive, longs pay shorts. A spot-long, perp-short position therefore receives funding.
Funding is usually quoted per interval. With a typical 8-hour interval there are 3 payments a day:
def annualized_funding(rate_per_interval, intervals_per_day=3):
return rate_per_interval * intervals_per_day * 365
print(round(annualized_funding(0.0001), 4))
rates = [0.0001, 0.0001, 0.00005, -0.0002, 0.0001, 0.0001]
notional = 60000
received = sum(notional * r for r in rates)
print(round(received, 2))The first result is 0.1095: a rate of 0.01% per interval is about 10.95% a year. The second result is 15.0. The six intervals pay 6, 6, 3, -12, 6 and 6, and the single negative rate wipes out most of the gains. Funding is variable, which separates this trade from the dated future, where you lock the premium at entry.
Comparing the two trades
| Property | Cash-and-carry (dated future) | Funding trade (perpetual) |
|---|---|---|
| Return source | Basis, fixed at entry | Funding payments, variable |
| End date | Expiry, known | None, you choose when to exit |
| Rate certainty | High if held to expiry | Low, can turn negative |
| Convergence | Forced by settlement | Only through funding pressure |
| Typical capital need | Spot plus margin | Spot plus margin |
Edge cases and costs
Fees on four trades. Each round trip includes a spot buy, a spot sell, a derivative sell and a derivative buy (unless held to expiry). Using maker orders lowers the cost. Slippage on thin books can erase a thin basis, so check depth before sizing.
Mark-to-market swings and margin. The hedge is neutral in total value, but the two legs sit in different places. If price rises sharply, the short loses money on the exchange while your spot gain sits in a wallet. The short may approach liquidation even though your overall position is flat. Keep spare margin, or use low leverage on the short leg, to survive spikes.
Basis can widen before it narrows. If you mark the position to market before expiry, the basis can move against you temporarily. This matters only if you must close early or if your margin runs out.
Funding sign flips. In sharp sell-offs, funding can turn negative for days. The short then pays. Decide in advance at what funding level or cumulative cost you exit.
Inverse contracts add exposure. If the short is on an inverse contract margined in BTC, your collateral value moves with price. A hedge in USD terms then needs adjusting, because the margin itself is an unhedged long position in BTC.
Counterparty and venue risk. Spot is held on one platform and the derivative on another, or both on the same one. An exchange failure, withdrawal freeze, or auto-deleveraging event (where a profitable position can be forcibly reduced when the insurance fund runs short) can break the hedge. Splitting across venues reduces concentration, but it also means you must move collateral between them.
Taxes and accounting. Gains on the two legs may be taxed differently or at different times. Check local rules before assuming the net return.
Deciding whether the trade is worth it
Compare the annualized return after costs with a risk-free alternative, such as lending stablecoins or holding short-term bonds. A 10% gross basis can shrink to 6% or 7% once you include fees, margin drag and the cost of tying up capital. If that is close to what stablecoin lending pays, the extra operational and counterparty risk may not be worth it.
A practical checklist:
- Annualize the basis or expected funding using the same method for both.
- Subtract round-trip fees and estimated slippage.
- Divide by total capital, including margin and the spot purchase, not by the spot cost alone.
- Stress-test a price spike of 30% to 50% against the margin on the short leg.
- Set exit rules for negative funding or a basis that collapses.
Exercise
Spot BTC is 50,000 and the 60-day future trades at 51,000. What is the annualized basis, using (futures / spot - 1) * 365 / days? Is a cash-and-carry gross return of that size reliable at expiry, and what two things reduce it?
Show answer
The premium is 51,000 / 50,000 - 1 = 2%. Annualized: 0.02 * 365 / 60 = 0.1217, about 12.2% per year. The premium is locked in if you hold to expiry, because the future settles to the spot index. Fees (spot and futures trading costs) and the margin you must lock on the short leg both reduce the net return on total capital.
Exercise
A perpetual's funding rate is 0.0003 per 8-hour interval and stays constant. What is the simple annualized rate, and how much does a short of 1 BTC at a mark price of 60,000 receive per day?
Show answer
Annualized: 0.0003 3 365 = 0.3285, or 32.85%. Per interval the short receives 60,000 0.0003 = 18, so per day it receives 18 3 = 54. This holds only while the rate stays positive and constant, which is unlikely for long.