Why funding exists
A perpetual contract has no expiry date — without a mechanism it would have no reason to track the spot price. The funding rate is that mechanism.
How it works
Every X hours (Hyperliquid: hourly, Binance: every 8 hours) a payment is settled between open longs and shorts, proportional to position size.
| Market condition | Funding rate | Payment |
|---|---|---|
| Perp > spot (premium, bullish) | positive | longs pay shorts |
| Perp < spot (discount, bearish) | negative | shorts pay longs |
| Perp ≈ spot | near 0 | negligible |
The rate is a percentage relative to the position notional. Example: 0.01 % hourly means 0.24 %/day = 87.6 %/year — not to be underestimated over longer holding periods.
How the rate is computed (Hyperliquid)
Hyperliquid uses a blend of: - Premium index — current deviation of the perp price from the 1-minute oracle price - Floor/cap — maximum rate per interval, prevents manipulation
Details in the Hyperliquid docs.
Impact on Botty
- Short-term trades (< 1h): funding negligible.
- Positions held for several hours: funding noticeable, can account for 10–20 % of net PnL.
- Positioned against the market: whoever holds long against a strong rally or short against a crash often pays hefty funding.
execution/trader.py currently does not account for funding explicitly in the signal process — the rate is deducted directly from equity by the exchange. For strategies with a typical holding time under 2h that is fine. Longer setups should treat funding as a holding cost.
Cash-and-carry: funding as income
In phases with persistently positive funding you can combine spot long + perp short: the price exposure cancels out, but you collect the funding payments from the longs. A classic delta-neutral trade, but exposed to smart-contract / execution risks.