Funding
Funding mechanism for perpetual contract price alignment
Funding
Funding is MuchFi's market-balancing mechanism that incentivizes traders to reduce skew by keeping perpetual contract prices aligned with spot prices. When longs outnumber shorts, longs compensate shorts, and vice versa.
How Funding Works
Cadence-Invariant System
MuchFi implements a sophisticated funding structure where realized funding is independent of when settlements happen. This ensures fairness regardless of timing.
The Premium Signal
MuchFi samples the premium—the gap between mark and index prices—every minute:
premium = (markPrice - indexPrice) / indexPriceThe system maintains a 60-minute rolling average (TWAP) of premium samples gathered every 5-15 seconds to reduce volatility noise.
Funding Rate Calculation
MuchFi uses a three-step process:
Step 0 - Premium Calculation
P̄_decimal = Mark / Index - 1
P̄ = 10,000 × P̄_decimalStep 1 - Inner Clamp
F_raw = P̄ + clamp(IR_int - P̄, -K, K)Step 2 - Outer Cap
F = clamp(F_raw, -C, C)Where K defaults to 50 basis points and C to 100 basis points.
Positive rates = Longs pay shorts Negative rates = Shorts pay longs
Funding Accrual
The rate converts to per-second accrual:
r_sec = F / T_intervalContinuous accumulation occurs in the Quote Funding Index (QFI).
Account Settlement
When positions change or funding settles:
funding_pnl = -sign(Q) × |Q| × (QFI - last_QFI)- Long positions (Q > 0) pay when F > 0
- Short positions (Q < 0) pay when F < 0
Dynamic Funding Intervals (RESET)
MuchFi shortens funding intervals during high volatility for faster market response.
RESETs trigger when:
- Premium divergence exceeds thresholds
- Market conditions shift rapidly
The process:
- Closes current intervals early
- Re-seeds premium sampling
- Starts fresh intervals
- Continues QFI accrual without payment interruption
Funding Parameters
| Parameter | Description | Default | Range |
|---|---|---|---|
| N_minutes | Premium TWAP window | 60 min | 5-1440 min |
| T_nominal | Nominal funding interval | 3600 sec | 1800-86400 sec |
| T_min | Minimum interval post-RESET | 300 sec | 60-3600 sec |
| K | Inner clamp | 50 bps | 10-200 bps |
| C | Outer cap | 100 bps | 50-500 bps |
Current settings: 1-hour funding intervals and 30-minute RESET intervals.
Worked Examples
Example 1: Normal Market
Conditions: $1000 index, $1006 mark, 60 bps premium
F_raw = 60 + clamp(0 - 60, -50, 50) = 10 bps
F = clamp(10, -100, 100) = 10 bpsResult: Longs pay shorts 0.1% hourly
Example 2: High Premium
Conditions: $1000 index, $1020 mark, 200 bps premium
F_raw = 200 + clamp(0 - 200, -50, 50) = 150 bps
F = clamp(150, -100, 100) = 100 bps (outer cap)Result: Longs pay shorts 1% hourly (capped)