Funding Costs in Perpetual Backtests: Use Settlement Timestamps
Funding is charged at specific settlement times. A backtest that spreads it evenly, or ignores it, misstates the cost of holding perpetual positions.
Short answer
In perpetual backtests, apply funding only at actual settlement timestamps, and only to positions open at those moments: notional × funding rate for that settlement, paid or received depending on side and sign. Use historical funding rates (Binance's fundingRate history includes fundingTime) and each contract's interval (some Binance symbols have adjusted intervals; Hyperliquid pays hourly). Positions opened and closed between settlements pay no funding; positions held across many settlements can pay more than fees.
Method
Example
| Settlement | Rate | Position (long) | Funding |
|---|---|---|---|
| 00:00 | +0.010% | $50,000 | −$5.00 |
| 08:00 | +0.030% | $50,000 | −$15.00 |
| 16:00 | −0.005% | $50,000 | +$2.50 |
Illustrative: a long held across three settlements pays $17.50 net. A trade opened at 01:00 and closed at 07:00 pays nothing.
Pitfalls
Related: Crypto Funding Rates: Compare One-Hour and Eight-Hour Payments, ChartsPod Backtesting: Set Fees and Slippage Before Comparing Results, Annualized Futures Premium: Calculate Carry After Fees and Funding.
Example: a strategy that only works without funding
Illustrative: a trend strategy on a perpetual holds positions for an average of five days, mostly long during rallies when funding is positive. Before funding, return is +22% a year; with historical funding applied at settlement times, it falls to +9%. The strategy is still positive, but funding is its largest cost, larger than fees. Testing a spot or dated-future version, or filtering entries when funding is extreme, becomes a sensible next step.
Conclusion
Apply historical funding at real settlement timestamps to positions open at those times, and report it separately.
Include funding when backtesting perpetual strategies.
Open the ChartsPod terminalCompare Funding Costs in Perpetual Backtests across Binance, Bybit, OKX and Hyperliquid markets.
Open markets in ChartsPodQuestions readers ask
Do I pay funding if I close before settlement?
No; funding applies to positions open at settlement.
Can I use an average funding rate?
It hides timing and sign changes; use historical rates.
How often is funding paid?
Depends on venue and contract: often 8 hours; Hyperliquid hourly.
Sources and methodology
Backtesting principles follow TradingView's Pine Script documentation on strategies, repainting and non-standard charts, and ChartsPod's strategies-and-backtests guide summary, as read on 17 October 2026. All numbers are illustrative and do not describe a real strategy's performance. Funding mechanics from Binance and Hyperliquid documentation.
- Binance: USD-M market data (long/short ratios, OI statistics, klines) — ratio definitions, 30-day retention, kline open/close time.
- Hyperliquid docs: Funding — hourly payments, 1/8 of the 8-hour rate, oracle price for notional.
- TradingView Pine Script: Strategies — simulated fills and assumptions.
This article explains research tools and workflows. It is not financial advice, does not recommend buying or selling any asset and does not predict prices. Crypto derivatives carry a risk of rapid and total loss of margin.
CHARTSPOD EDITORIAL EDITION · RESEARCH AND EDUCATION ONLY · NOT FINANCIAL ADVICE.