Skip to content

Funding Rate

Funding rate is a mechanism in perpetual futures that ensures the futures price stays close to the spot price. Traders pay or receive funding fees at regular intervals (usually every 8 hours).

ExchangeStatusDescription
Bybit✅ LivePerpetual USDT Futures
KuCoin✅ LivePerpetual USDT Futures

For each trading pair (e.g., BTCUSDT), the system collects:

FieldDescriptionExample
exchangeExchange name”bybit”
symbolTrading pair (normalized)“BTCUSDT”
funding_rateCurrent rate0.0001 (0.01%)
funding_rate_intervalInterval in hours8.0
next_funding_ratePredicted next rate0.00012
next_funding_timestampNext funding time1734336000
Formula:
APR = funding_delta × (8760 / epoch_hours)
Where:
- funding_delta = |rate_exchange_A - rate_exchange_B|
- epoch_hours = funding interval (usually 8 hours)
- 8760 = total hours in a year
Example:
- funding_delta = 0.0004 (0.04%)
- epoch_hours = 8
- APR = 0.0004 × (8760 / 8) = 0.438 = 43.8% per year
┌──────────────────────────────────────────────────────────────┐
│ DATA COLLECTION FLOW │
├──────────────────────────────────────────────────────────────┤
│ │
│ 1. MATCH PAIRS DISCOVERY (continuous) │
│ ├─▶ Fetch all symbols from Bybit │
│ ├─▶ Fetch all symbols from KuCoin │
│ ├─▶ Find intersection (symbols on both exchanges) │
│ └─▶ Save matched pairs │
│ │
│ 2. FETCH FUNDING RATES (continuous) │
│ ├─▶ For each matched pair: │
│ │ ├─▶ Fetch funding rate from Bybit │
│ │ └─▶ Fetch funding rate from KuCoin │
│ └─▶ Save to database │
│ │
│ 3. COMPUTE OPPORTUNITIES (continuous) │
│ ├─▶ Compare funding rates between exchanges │
│ ├─▶ Calculate APR and direction │
│ └─▶ Update opportunity list │
│ │
└──────────────────────────────────────────────────────────────┘