Funding is the recurring payment between longs and shorts that keeps a perpetual’s price tied to spot — if you need the full mechanics, start with our funding rate guide and the perpetuals beginners guide. This article is about something narrower and, for anyone comparing backtest results, more consequential: most backtests that claim to “include funding” model it wrong. Ours did too, until August 2026. Here are the three errors, verified against exchange documentation and raw API data, and the model we replaced them with.
Error 1: Treating funding as a meter instead of an event
The common shortcut is pro-rata: holding hours divided by 8, times a rate. But OKX and Binance official docs agree on the mechanics — funding is paid or received only if you hold the position at the settlement timestamp (UTC 00:00 / 08:00 / 16:00 by default), and closing just before settlement explicitly exempts you. A duration-based formula ignores where your trade sits relative to those boundaries, which produces an error of ±1 settlement per trade. For short-hold strategies — the ones that cross zero or one boundary — that is a relative error above 100%.
Error 2: “Shorts always collect”
Positive funding is the long-run norm, so many backtests hardcode funding as income for shorts. Counting raw API records says otherwise: in an OKX BTC window from Jul–Aug 2026, 9 of 100 settlements were negative; in a Binance BTC window from Jun 2022, 30 of 100 were. Depending on the regime, the “shorts always collect” assumption is wrong 9–30% of the time — and it is wrong in the direction that flatters short strategies.
Error 3: The flat 0.01% per 8h
That textbook constant annualizes to 10.95%. Measured against real rate history, no single constant survives: on the same two 100-settlement windows from Error 2, the average was 4.87% annualized (OKX BTC, Jul–Aug 2026) and 3.07% (Binance BTC, Jun 2022) — the constant overstates those windows 2.25x to 3.57x. Yet BTC’s full history (Sep 2019–Aug 2026, 7,591 settlements) averages 11.63% annualized, slightly above the constant, dominated by the 2019–2021 bull extremes. Funding is regime-dependent — a flat number is wrong in both directions depending on when you backtest, and whichever side of the trade you’re on, that’s not noise; it reshapes the net return.
We made all three mistakes
Full disclosure: until August 2026, PRUVIQ’s own simulator computed funding as holding_time // 8h × constant, with shorts always collecting — every error on this list. Our April article on trading fees reported funding lines produced by that model. This post exists because we replaced it.
The model we use now
The current implementation follows the practice documented by QuantConnect and Freqtrade: settlement-timestamp events × the actual historical rate at that timestamp × notional at settlement (settlement-bar close over entry price, so the charge reflects the position’s value when funding is actually taken). The sign follows the rate itself: longs pay a positive rate, shorts receive it, and everything flips automatically when the rate goes negative. There is no “shorts collect” branch to be wrong.
Rate history comes from Binance’s /fapi/v1/fundingRate endpoint — full history since September 2019, no authentication required. OKX’s public API retains only about 3 months of funding history, which disqualifies it as a backtest source.
What we still can’t do (and say so)
- OKX universe, Binance rates. Our live universe is OKX-listed, so Binance funding rates serve as an approximate proxy. We disclose this on the methodology page rather than pretending it away.
- Missing symbols get 0, not a guess. If a symbol has no rate history, its funding term is simply 0 — we don’t backfill with an invented constant. Freqtrade’s docs are blunt about that alternative: substituting an arbitrary constant is precisely how “backtesting results will be inaccurate.” We agree — the constant is how we got here. (Surfacing a per-run “funding not modeled” flag in the results UI is on our list; today the disclosure lives on the methodology page.)
Every simulator run now shows its funding line computed this way — pick a strategy and see what settlement-event funding does to the net: /simulate/