What Risks Does a Perpetual Contract Backtest Miss by Only Charging Funding Fees at Close?

 / 
2

In a backtest that "only charges the funding fee once at close," the most direct consequence is that it compresses a path-dependent, ongoing cash flow into a fixed cost that does not vary with holding time. The core risk it misses is not just "slightly underestimating a fee," but that the strategy's profit and loss structure is distorted: a position held for 2 hours versus 20 hours, or one that crosses 0 versus 6 settlement points, can have funding fee expenses that differ by several times in a real account, yet they look exactly the same in this kind of backtest.

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

Funding Fees Are Discrete Settlements, Not Continuous Accruals

Perpetual contract funding fees are settled at fixed time points. Binance and OKX USDT perpetuals default to every 8 hours (00:00, 08:00, 16:00 UTC), and some contracts may shorten this to 1, 2, or 4 hours. The key rule is: you only pay or receive the funding fee if you actually hold a position at the settlement moment. Close before the 08:00 settlement, and you do not pay for that period; open one second after 08:00, and that period has nothing to do with you.

A backtest that "charges once at close" usually takes an average daily rate or a single fee rate, multiplies it by the position notional value, and deducts it once when the trade ends. This creates errors in two directions:

Positions crossing multiple settlement points have fees severely underestimated. Suppose you go long with 10,000 USDT notional value, and the funding rate is +0.01% every 8 hours. Holding for 24 hours crosses 3 settlement points, so the real expense is 3 × 10,000 × 0.01% = 3 USDT. If the backtest only deducts 0.01% once at close, it records an expense of 1 USDT. Hold for 3 days, the real expense is 9 USDT, but the backtest still only deducts 1 USDT. The longer the holding time, the worse the underestimation. During periods of high funding rates, this error can become large enough to change the strategy's profit and loss judgment — a trend-following long strategy that appears "slightly profitable" in the backtest may become a loss after deducting the real cumulative funding fees.

Positions that do not cross a settlement point have fees wrongly deducted. If you run an intraday strategy that opens at 00:30 and closes at 07:30, the real funding fee is zero. But a backtest that "charges once at close" will incorrectly deduct a fee, systematically suppressing the performance of high-frequency or short-holding strategies.

Path Dependency: Same Entry and Exit Prices, Different P&L

Funding fees are path-dependent cash flows. Two trades can have exactly the same entry price and exit price, but if one crosses settlement points with high positive rates while the other crosses settlement points with low or negative rates, the final net P&L can be completely different.

A backtest that "charges once at close" erases this dimension. It makes all trades in the same direction with the same notional value appear to bear the same funding fee cost, regardless of what rate path they actually experienced. For strategies with unfixed holding times, such as trend following or breakout strategies, this prevents the backtest from distinguishing between "profitable trades held during low-rate windows" and "losing trades stubbornly held through high-rate windows," even though these are completely different trades in live trading.

The Rate Itself Changes, Fixed Assumptions Fail

Funding rates are determined by the premium index and interest rate, and they float with market crowding on the long or short side. In trending markets, positive rates can rise from a baseline of 0.01% to 0.05% or higher; in sharp sell-offs, they can turn negative. If a backtest uses a fixed "charge once at close" rate, it cannot reflect the impact of rate reversals on the strategy.

A specific scenario: you are long, and during the holding period the funding rate shifts from +0.01% to -0.01%. In reality, in the second half you change from "paying funding fees" to "receiving funding fees," so the net cost may be far lower than what a fixed positive rate would estimate. Conversely, in a crowded bull market with heavy long positioning, rates may remain persistently high, and a fixed low-rate assumption would severely underestimate holding costs. For strategies that rely on funding fees as a source of income, such as funding fee arbitrage, this modeling approach completely fails — the core profit of an arbitrage strategy is the funding fee income collected at each settlement, and the "charge once" logic turns it into something impossible to evaluate.

How a Backtest Should Deduct Funding Fees

The correct approach is to process each settlement timestamp one by one, rather than handling it once at the close event.

In the backtest engine, maintain a funding fee settlement timeline. At each settlement moment, check whether there is an open position at that time. If there is, use the notional value at that moment and the actual rate at that settlement moment to calculate the cash flow: when the rate is positive, longs pay and shorts receive; when negative, the direction reverses. The fee or income is immediately recorded in the equity curve, rather than waiting until the position is closed.

What needs to be distinguished is the rate basis. The funding rate shown on the Binance interface is an "estimate of the past 8 hours' premium index," used as a reference for the next settlement, not a rate that has already occurred. A backtest should use the actual historical rate data executed at each settlement moment, not the interface estimate or a daily average. Different exchanges and different contracts may have different settlement cycles and rates, so cross-exchange strategies cannot mix a single rate series.

A simplified but still flawed approach is to accrue continuously using "holding hours × an hourly equivalent rate." This is closer to the real cost than "charging once at close," but it introduces a new error: it smooths out discrete settlement points and cannot accurately reflect the step effect of "holding one second past 08:00 means paying the full period fee." For strategies with holding times measured in hours or days, the step effect is real. Continuous accrual will underestimate the cost shock when a short holding crosses a settlement point, and overestimate the cost when it does not cross one.

My judgment is: if you are evaluating a perpetual strategy whose holding time may exceed 8 hours, a backtest result based on "charge once at close" has no reference value. The longer the holding time and the greater the rate volatility, the more severely this error contaminates the conclusion. Before running any perpetual backtest, first confirm whether the engine processes funding fees one by one at settlement timestamps and uses actual historical rate data matching the trading venue. If not, fix the engine first, then look at the results.

OKX Exchange
A leading global cryptocurrency platform,suitable for both beginners and experienced traders.
New user benefit: 20% off trading fees upon registration!!

References

  1. Binance Perpetual Contract Funding Fee Explanation
  2. OKX Perpetual Contract Funding Fee Mechanism Explanation
  3. Research on the Importance of Funding Rates in Backtests
  4. Articles on Perpetual Contract Backtesting Funding Costs
  5. Bitcoin Perpetual Funding Rate Analysis
  6. Historical Funding Rate Backtesting Tutorial
  7. Rustrade Backtest Framework Funding Fee Settlement Explanation