Funding Rate - How Perpetual Contracts Stay Aligned with Spot
TL;DR
Funding rate is a periodic payment between longs and shorts that keeps perpetual contract prices aligned with spot prices.
- Positive funding → Longs pay Shorts (perp trading above spot)
- Negative funding → Shorts pay Longs (perp trading below spot)
- Typical rate: 0.001% to 0.01% per 8-hour period (very small)
- Bounds: ±100 basis points (±1%) default, configurable per market
- Payment interval: Typically hourly (rate calculated over 8 hours, paid in installments)
Why Funding Rate Exists
Perpetual contracts have no expiry date. Unlike traditional futures that settle at a fixed date, perps can trade forever. Without a mechanism to anchor them, the price could drift far from spot.
The problem:
Spot BTC: $100,000
Perp BTC: $105,000 (traders are bullish)
Without funding: Perp could stay at $105,000 indefinitely
With funding: Longs pay shorts → incentivizes selling → price convergesHow Funding Actually Keeps Prices Aligned
Key insight: Closing a LONG = SELLING
When you OPEN a long: You BUY the contract (pushes price up)
When you CLOSE a long: You SELL the contract (pushes price down)The Complete Mechanism
Scenario: Perp at $105, Spot at $100 (5% premium)
Perp price too high ($105 vs $100 spot)
↓
Funding rate goes positive (+1%)
↓
Longs have to PAY money every hour
↓
Longs think "I don't want to keep paying"
↓
Longs CLOSE their positions
↓
Closing a long = SELLING
↓
More sellers than buyers
↓
Price goes DOWN toward spotThree Forces at Work
1. Direct Cost Pressure
You're LONG $100,000
Funding: +1% per 8hr = $1,000 cost
"This is expensive, maybe I should close"
You close (SELL) → Price drops2. New Position Incentives
Funding: +1%
Opening LONG: You'll PAY funding
Opening SHORT: You'll RECEIVE funding
"Why go long and pay? I'll short and get paid!"
More shorts = More SELLING = Price drops3. Arbitrage
Perp: $105 (expensive)
Spot: $100 (cheap)
Arbitrageur:
1. SHORT perp at $105
2. BUY spot at $100
3. Collect funding (shorts receive)
4. Wait for convergence
5. Profit!
Arbitrage = SELLING pressure on perp = Price dropsVisual Flow
Perp trading ABOVE spot
│
▼
Positive funding rate
│
▼
Longs PAY shorts
│
├─────────────────────────────┐
▼ ▼
Longs close (SELL) New shorts open (SELL)
│ │
└──────────┬──────────────────┘
▼
SELLING PRESSURE
▼
Price drops toward spot
▼
Premium shrinks
▼
Funding rate drops
▼
Equilibrium: Perp ≈ SpotThe Core Formula
Premium (How Far Perp Is From Spot)
Premium = (Mark Price - Index Price) / Index PriceExample:
Mark Price (perp): $100,500
Index Price (spot): $100,000
Premium = ($100,500 - $100,000) / $100,000 = +0.5%Funding Rate
Funding Rate = Average(Premium samples over interval)
= Clamped to bounds (e.g., ±1%)Who Pays Whom?
| Funding Rate | Market Condition | Payment Direction |
|---|---|---|
| Positive (+) | Perp > Spot (bullish) | Longs PAY Shorts |
| Negative (-) | Perp < Spot (bearish) | Shorts PAY Longs |
| Zero (0) | Perp ≈ Spot | No payment |
Payment Calculation
Payment = |Funding Rate| × |Position Notional|
= |Funding Rate| × |Position Quantity| × Mark PriceExample:
Position: LONG 10 SOL
Mark Price: $100
Position Notional: 10 × $100 = $1,000
Funding Rate: +0.01%
Payment = 0.01% × $1,000 = $0.10
You PAY $0.10 to shortsBounds / Caps
Backpack's Default Bounds
upper_bound_bps: 100 // +1% max
lower_bound_bps: -100 // -1% minBounds are per-market - different markets can have different caps:
| Market Type | Typical Bounds | Why |
|---|---|---|
| BTC, ETH (very liquid) | ±50-75 bps | Tighter caps, high liquidity |
| SOL, majors | ±100 bps | Default |
| Smaller/volatile markets | ±100-500 bps | Wider to allow natural price discovery |
How Clamping Works
Calculated funding rate: +2.5%
Bounds: ±1%
Actual funding rate: +1.0% (capped)
Calculated funding rate: -3.0%
Bounds: ±1%
Actual funding rate: -1.0% (capped)Why caps?
- Protects traders from extreme costs
- Prevents funding from becoming punitive
- Maintains market stability in volatile conditions
Realistic Funding Rate Examples
Funding rates are typically very small:
| Market Condition | Rate (per 8hr) | On $100k Position | Monthly Cost |
|---|---|---|---|
| Neutral | ~0% | ~$0 | ~$0 |
| Normal | 0.005% | $5 | ~$450 |
| Slightly elevated | 0.01% | $10 | ~$900 |
| High | 0.05% | $50 | ~$4,500 |
| Very high | 0.1% | $100 | ~$9,000 |
| Max (capped at 1%) | 1% | $1,000 | ~$90,000 |
The 1% cap is rarely hit. Most of the time: $5-50 per 8 hours on $100k.
Payment Timing
Backpack's Approach
| Parameter | Typical Value |
|---|---|
| Funding Period | 8 hours (rate calculated over this) |
| Payment Interval | 1 hour (payments made this often) |
How It Works
With FundingPaymentInterval strategy:
8-hour funding rate calculated: 0.08%
Paid in 8 hourly installments:
Hour 1: 0.01% (0.08% ÷ 8)
Hour 2: 0.01%
Hour 3: 0.01%
...
Hour 8: 0.01%
Total: 0.08%Why hourly payments?
- Smoother cash flow for traders
- Less sudden impact than one big payment
- Easier to manage positions
Timeline
00:00 ─── 01:00 ─── 02:00 ─── ... ─── 08:00
│ │ │ │
│ Sample │ Sample │ Sample │
│ premium│ premium│ premium │
│ │ │ │
└─ Pay ──┴─ Pay ──┴─ ... ───────────┘
1/8 1/8
of rate of rateThree Funding Rate Strategies
Backpack supports 3 different calculation strategies:
1. ArithmeticMean (Default)
funding_rate = Clamp(Average Premium, lower_bound, upper_bound)When used: Most markets - simple, transparent, purely market-driven.
How it works:
- Collect premium samples throughout the period
- Average them
- Clamp to bounds
- Done
2. ArithmeticMeanWithInterest
funding_rate = Clamp(Average Premium + Interest Rate, bounds)When used: Markets where borrowing cost matters.
How it works:
- Same as ArithmeticMean
- PLUS a base interest rate component
- Even if premium = 0, there's a small baseline rate
Why: Mimics traditional futures where there's a "cost of carry" (borrowing cost). Some markets want funding to reflect this.
3. FundingPaymentInterval
funding_rate = (8-hour calculated rate) / (period / interval)When used: Exchange compatibility.
How it works:
- Calculate rate over 8-hour period (like Binance, Deribit)
- But pay every hour at 1/8 of the rate
- Total over 8 hours = same as one big payment
Why:
- Traders can compare rates with other exchanges
- But get smoother, more frequent settlements
- Best of both worlds
Strategy Comparison
| Strategy | Complexity | Use Case |
|---|---|---|
| ArithmeticMean | Simple | Pure market-driven funding |
| ArithmeticMeanWithInterest | Medium | When cost of capital matters |
| FundingPaymentInterval | Medium | Compatibility with other exchanges |
Step-by-Step Example
Starting Point:
Perp: $105
Spot: $100
Premium: +5%
Market is very bullishHour 1:
Funding: +0.75% (capped at 1%)
Longs pay $750 per $100k position
Some longs: "This is expensive" → Close (SELL)
Perp drops to $104Hour 2:
Funding: +0.75%
Arbitrageurs see opportunity
Short perp + buy spot
More SELLING pressure
Perp drops to $103Hour 3:
Premium now +3%
Funding: +0.5%
Less painful but still costly
Perp drops to $102Hours 4-8:
Gradual convergence:
- Expensive longs close
- New shorts open
- Arbitrageurs profitHour 8:
Perp: $100.20
Spot: $100
Premium: +0.2%
Funding: +0.2%
Near equilibrium ✓Impact on Trading Decisions
When to Care About Funding
| Holding Period | Funding Impact | Consideration |
|---|---|---|
| Minutes/hours | Minimal | Usually cross 0-1 intervals |
| Days | Moderate | Factor into position sizing |
| Weeks/months | Significant | Can erode profits substantially |
Funding as a Trading Signal
| High Positive Funding | High Negative Funding |
|---|---|
| Market very bullish | Market very bearish |
| Crowded long trade | Crowded short trade |
| Expensive to be long | Expensive to be short |
| Contrarian signal? | Contrarian signal? |
Basis Trading (Cash-and-Carry Arbitrage)
What Is a Basis Trade?
Basis = Perp Price - Spot Price
When perp trades above spot (positive basis), you can capture this spread:
Perp: $105
Spot: $100
Basis: +$5 (+5%)
Basis Trade:
1. SHORT perp at $105
2. BUY spot at $100
3. Collect positive funding (shorts receive)
4. Wait for basis to shrink
5. Close both positions for profitThis is also called cash-and-carry arbitrage:
- Cash = Buy the spot asset
- Carry = Hold it while short futures
Why It Works
Your position is delta neutral - no directional exposure:
If BTC goes to $110:
Spot position: +$10 profit
Perp short: -$10 loss
Net: $0 (delta neutral)
If BTC goes to $90:
Spot position: -$10 loss
Perp short: +$10 profit
Net: $0 (delta neutral)
You profit from:
1. Basis convergence (perp → spot)
2. Funding payments (shorts receive when positive)Example P&L
Entry:
SHORT 1 BTC perp @ $105,000
BUY 1 BTC spot @ $100,000
Capital required: $100,000 (for spot) + margin for short
Over 30 days:
Funding rate: +0.01% per 8hr (typical)
Funding received: 0.01% × $105,000 × 90 intervals = ~$945
At close (basis converged to +1%):
Perp now: $101,000
Spot now: $100,000
Close SHORT perp: $105,000 - $101,000 = $4,000 profit
Sell SPOT: $100,000 - $100,000 = $0
Total profit:
Basis capture: $4,000
Funding received: $945
Total: $4,945 on $100,000 = 4.9% monthly returnContango vs Backwardation
These are fancy words for a simple concept:
| Term | Meaning | Plain English |
|---|---|---|
| Contango | Perp > Spot | People pay a premium to go long (bullish) |
| Backwardation | Perp < Spot | People pay a premium to go short (bearish) |
Memory trick:
- Contango = Futures Continuing higher (premium)
- Backwardation = Futures Backing down (discount)
Contango (bull market): Backwardation (bear market):
Perp: $102,000 Perp: $97,000
Spot: $100,000 Spot: $100,000
Basis: +2% Basis: -3%
Basis trade: WORKS ✓ Basis trade: FAILS ✗When Does Basis Trading Work?
| Market Condition | Basis | Funding | Basis Trade |
|---|---|---|---|
| Contango (bullish) | Positive (perp > spot) | Positive | Works ✓ |
| Backwardation (bearish) | Negative (perp < spot) | Negative | Doesn't work ✗ |
Historical pattern:
2017: Bull → Contango → Basis trade works
2018: Bear → Backwardation → Basis trade fails
2020-2021: Bull → Contango → Works great
2022: Bear → Backwardation → Fails
2023-2024: Mixed → Sometimes worksEven in a long-term bull market, there are 1-2 year bear periods where basis trading loses.
Basis Trading vs Just Holding
Critical insight: Basis trading is DELTA NEUTRAL - you don't capture price appreciation.
You believe: BTC will 10x over 10 years
Option A - Just Hold:
Buy 1 BTC at $100k
BTC goes to $1M
Profit: +$900k (900%)
Option B - Basis Trade:
SHORT 1 BTC perp + LONG 1 BTC spot
BTC goes to $1M
Spot: +$900k
Short: -$900k
Net from price: $0 ← You missed the entire rally!
Only made: Funding + basis (~15% APY)Basis Trade: Cost/Benefit Summary
BENEFITS:
| Benefit | Description |
|---|---|
| Delta neutral | No directional risk (price can go either way) |
| Predictable income | Funding payments are steady in contango |
| Lower volatility | Returns don't swing with BTC price |
| Works in sideways markets | Don't need price to move, just need positive basis |
| Compounds well | Can reinvest funding payments |
COSTS:
| Cost | Description |
|---|---|
| Miss the upside | If BTC moons, you don't benefit |
| Fails in bear markets | Backwardation = losing trade |
| Capital intensive | Need to buy and hold spot |
| Execution costs | Fees to enter/exit both legs |
| Liquidation risk | Short can get liquidated if price spikes |
| Opportunity cost | Capital locked, can't use elsewhere |
| Timing required | Need to exit before backwardation |
WHO SHOULD USE IT:
| Use Basis Trading If... | Don't Use If... |
|---|---|
| You want steady income | You're bullish and want upside |
| You're market-neutral | You think BTC will 10x |
| You already hold BTC and want yield | You have limited capital |
| You're a professional market maker | You can't monitor positions |
| You understand the risks | You don't understand liquidation |
SIMPLE DECISION FRAMEWORK:
Are you bullish long-term on BTC?
│
├─ YES → Just hold BTC (capture the upside)
│ Maybe use 20-30% for basis trades
│
└─ NO/NEUTRAL → Basis trading can work
But exit during bear marketsWhen to Close
You don't have to wait for perp = spot. Close when:
| Trigger | Action |
|---|---|
| Basis shrinks to target profit | Close for gain |
| Funding turns negative | Close before paying |
| Market turns bearish | Close before basis inverts |
| Better opportunity | Redeploy capital |
Example timing:
Entry: Basis = +5%
Target: Basis = +1%
Close when basis hits +1%
Capture 4% basis + funding collected
Don't wait for 0%Can You Do This Repeatedly?
Yes, but with caveats:
| Advantage | Challenge |
|---|---|
| Works whenever basis is positive | Basis isn't always positive |
| Delta neutral (low risk) | Capital intensive |
| Predictable funding income | Liquidation risk on short if price spikes |
| Repeatable strategy | Execution costs eat into profits |
Realistic expectations:
Bull market (basis positive): 10-30% APY possible
Bear market (basis negative): Strategy doesn't work
Mixed market: 5-15% APY if timed wellPro Tips
1. Entry timing:
Good entry: Basis > 3%, Funding > 0.03% per 8hr
Okay entry: Basis > 1%, Funding > 0.01% per 8hr
Bad entry: Basis < 1% or Funding < 0.01%2. Exit timing:
Take profit: Basis shrinks by 50%+
Cut loss: Funding turns negative
Reassess: Basis < 0.5%3. Risk management:
- Don't use max leverage on short (leave buffer for spikes)
- Keep some capital in reserve
- Watch funding rate trend, not just current rateTechnical Implementation
Data Flow
┌─────────────────────────────────────────────────────────────┐
│ Continuous (every few seconds): │
│ │
│ Mark Price ──┐ │
│ ├──→ Premium = (Mark - Index) / Index │
│ Index Price ─┘ │ │
│ ↓ │
│ Add to interval_funding_rate_sum │
│ Increment sample_count │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ At interval end (funding crank): │
│ │
│ 1. average = sum / sample_count │
│ 2. funding_rate = Clamp(average, lower, upper) │
│ 3. For each position: │
│ payment = |rate| × |quantity| × mark_price │
│ if long and rate > 0: pay │
│ if short and rate > 0: receive │
│ 4. Reset accumulators │
│ 5. Emit FundingRateUpdatedEvent │
└─────────────────────────────────────────────────────────────┘Ledger Balancing
Funding is zero-sum - money moves between traders, not in/out of system:
Total paid by longs = Total received by shorts
(with tiny rounding adjustment)Storage
| Storage | What | Purpose |
|---|---|---|
| Engine (in-memory) | Current interval data | Real-time calculation |
| PostgreSQL | Market configuration, bounds | Settings |
| ClickHouse | Historical rates & payments | Analytics, audit |
Key Files
| Component | Location |
|---|---|
| Funding rate models | /engine/src/models/funding_rate.rs |
| Payment processing | /engine/src/engine/funding_rate.rs |
| Strategy definitions | /core/types/src/models/order_book.rs |
| Bounds configuration | /core/types/src/models/order_book.rs |
| Funding crank | /cronjobs/src/funding.rs |
| Market creation (CLI) | /cli/src/market.rs |
| ClickHouse models | /clickstore/core/src/models/funding_rate.rs |
Summary
| Question | Answer |
|---|---|
| What is funding rate? | Periodic payment to align perp with spot |
| Who pays? | Side pushing price away from spot |
| How much? | Typically 0.001% - 0.01% per 8hr |
| How often? | Hourly payments (configurable) |
| Is it capped? | Yes, ±1% default (per-market configurable) |
| Why does it exist? | Economic pressure → closing/opening → price converges |
| How does closing a long drop price? | Closing LONG = SELLING = price down |