Skip to content

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 converges

How 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 spot

Three 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 drops

2. 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 drops

3. 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 drops

Visual 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 ≈ Spot

The Core Formula

Premium (How Far Perp Is From Spot)

Premium = (Mark Price - Index Price) / Index Price

Example:

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 RateMarket ConditionPayment Direction
Positive (+)Perp > Spot (bullish)Longs PAY Shorts
Negative (-)Perp < Spot (bearish)Shorts PAY Longs
Zero (0)Perp ≈ SpotNo payment

Payment Calculation

Payment = |Funding Rate| × |Position Notional|
        = |Funding Rate| × |Position Quantity| × Mark Price

Example:

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 shorts

Bounds / Caps

Backpack's Default Bounds

rust
upper_bound_bps: 100   // +1% max
lower_bound_bps: -100  // -1% min

Bounds are per-market - different markets can have different caps:

Market TypeTypical BoundsWhy
BTC, ETH (very liquid)±50-75 bpsTighter caps, high liquidity
SOL, majors±100 bpsDefault
Smaller/volatile markets±100-500 bpsWider 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 ConditionRate (per 8hr)On $100k PositionMonthly Cost
Neutral~0%~$0~$0
Normal0.005%$5~$450
Slightly elevated0.01%$10~$900
High0.05%$50~$4,500
Very high0.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

ParameterTypical Value
Funding Period8 hours (rate calculated over this)
Payment Interval1 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 rate

Three 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

StrategyComplexityUse Case
ArithmeticMeanSimplePure market-driven funding
ArithmeticMeanWithInterestMediumWhen cost of capital matters
FundingPaymentIntervalMediumCompatibility with other exchanges

Step-by-Step Example

Starting Point:

Perp: $105
Spot: $100
Premium: +5%
Market is very bullish

Hour 1:

Funding: +0.75% (capped at 1%)
Longs pay $750 per $100k position
Some longs: "This is expensive" → Close (SELL)
Perp drops to $104

Hour 2:

Funding: +0.75%
Arbitrageurs see opportunity
Short perp + buy spot
More SELLING pressure
Perp drops to $103

Hour 3:

Premium now +3%
Funding: +0.5%
Less painful but still costly
Perp drops to $102

Hours 4-8:

Gradual convergence:
- Expensive longs close
- New shorts open
- Arbitrageurs profit

Hour 8:

Perp: $100.20
Spot: $100
Premium: +0.2%
Funding: +0.2%
Near equilibrium ✓

Impact on Trading Decisions

When to Care About Funding

Holding PeriodFunding ImpactConsideration
Minutes/hoursMinimalUsually cross 0-1 intervals
DaysModerateFactor into position sizing
Weeks/monthsSignificantCan erode profits substantially

Funding as a Trading Signal

High Positive FundingHigh Negative Funding
Market very bullishMarket very bearish
Crowded long tradeCrowded short trade
Expensive to be longExpensive 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 profit

This 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 return

Contango vs Backwardation

These are fancy words for a simple concept:

TermMeaningPlain English
ContangoPerp > SpotPeople pay a premium to go long (bullish)
BackwardationPerp < SpotPeople 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 ConditionBasisFundingBasis Trade
Contango (bullish)Positive (perp > spot)PositiveWorks ✓
Backwardation (bearish)Negative (perp < spot)NegativeDoesn'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 works

Even 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:

BenefitDescription
Delta neutralNo directional risk (price can go either way)
Predictable incomeFunding payments are steady in contango
Lower volatilityReturns don't swing with BTC price
Works in sideways marketsDon't need price to move, just need positive basis
Compounds wellCan reinvest funding payments

COSTS:

CostDescription
Miss the upsideIf BTC moons, you don't benefit
Fails in bear marketsBackwardation = losing trade
Capital intensiveNeed to buy and hold spot
Execution costsFees to enter/exit both legs
Liquidation riskShort can get liquidated if price spikes
Opportunity costCapital locked, can't use elsewhere
Timing requiredNeed to exit before backwardation

WHO SHOULD USE IT:

Use Basis Trading If...Don't Use If...
You want steady incomeYou're bullish and want upside
You're market-neutralYou think BTC will 10x
You already hold BTC and want yieldYou have limited capital
You're a professional market makerYou can't monitor positions
You understand the risksYou 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 markets

When to Close

You don't have to wait for perp = spot. Close when:

TriggerAction
Basis shrinks to target profitClose for gain
Funding turns negativeClose before paying
Market turns bearishClose before basis inverts
Better opportunityRedeploy 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:

AdvantageChallenge
Works whenever basis is positiveBasis isn't always positive
Delta neutral (low risk)Capital intensive
Predictable funding incomeLiquidation risk on short if price spikes
Repeatable strategyExecution 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 well

Pro 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 rate

Technical 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

StorageWhatPurpose
Engine (in-memory)Current interval dataReal-time calculation
PostgreSQLMarket configuration, boundsSettings
ClickHouseHistorical rates & paymentsAnalytics, audit

Key Files

ComponentLocation
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

QuestionAnswer
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