2026-12-04 · The Spera team
How to Backtest Crypto Futures With Funding Rates and Leverage
How to backtest Binance futures honestly. Model funding rates, fees, slippage, leverage and liquidation so a perpetual futures backtest matches the account.
TL;DR
- A perpetual futures backtest that only replays candles is a spot backtest with a leverage multiplier. It leaves out the things that decide whether a futures account survives: funding, fees on the full notional, maintenance margin, and liquidation.
- Funding is paid at each settlement you hold through. When the rate is positive, longs pay shorts. A strategy that holds longs for days can pay more in funding than its edge earns.
- Leverage doesn't change your edge per unit of notional. It changes how far price can move against you before the exchange closes the position, and it multiplies every cost that is charged on notional.
- Liquidation on Binance is triggered by the mark price, not the last traded price. A backtest that uses candle wicks will liquidate at different moments than the exchange did.
- If you use the funding rate as a signal, only read a rate after it was settled. Reading it early is look-ahead bias, and it makes fake edge.
There's a checklist table further down. If you're new to backtesting in general, start with how to backtest a crypto trading strategy and come back here for the futures-specific parts.
What is a perpetual future, and why does a spot backtest lie about it?
A perpetual future is a futures contract with no expiry date. You can hold a long or short position indefinitely, usually with leverage, and you never take delivery of the coin.
A dated future converges to the spot price because it expires. A perpetual has no expiry, so exchanges use a different mechanism to keep its price near spot: funding, a periodic payment between longs and shorts.
A typical spot backtest assumes:
- Holding a position is free between entry and exit.
- The worst outcome of a trade is the stop you set.
- Fees are charged on the cash you put in.
On a leveraged perpetual, none of these hold. Holding costs or earns funding at every settlement. The exchange can close you before your stop is reached. And fees are charged on the position's full notional value, which at 5× leverage is five times the margin you posted.
How do funding rates work on Binance?
Binance's own explanation is in its introduction to futures funding rates. As of December 2026, that page states:
- Interval. The default funding interval is 8 hours, settling at 00:00, 08:00 and 16:00 UTC. Binance can change a contract's interval, including moving it to hourly settlement when the rate hits its cap or floor.
- Direction. A positive rate means longs pay shorts. A negative rate means shorts pay longs. Payments go between traders, and Binance doesn't take a cut.
- Amount. The payment is the position's nominal value (mark price × size) × the funding rate.
- Who pays. Only positions open at the funding time pay or receive. Close before the settlement and you pay nothing for that interval.
- Composition. The rate combines an interest-rate component (0.01% per 8-hour interval for most contracts) and a premium index that measures how far the perpetual trades from the index price. When the premium is small, the rate equals the interest component.
- Caps. Rates are clamped to a cap and floor that depend on the contract.
Intervals and caps change, so check the page before you rely on them.
Three consequences for backtesting follow from these rules:
- Funding scales with notional, not margin. Leverage multiplies it.
- Funding depends on timing. Whether a trade pays depends on whether it is open at the settlement instant, so the backtest has to know when settlements happened and when your orders filled.
- Funding is history-dependent. You need the rates Binance actually settled, not an assumed average.
How can funding turn a small edge negative?
Here is a worked example. Every number in it is hypothetical arithmetic, chosen to show the mechanism. It is not a result from any strategy, and it isn't a forecast of any rate.
Suppose a trend strategy on a perpetual:
- Goes long only.
- Averages a gross gain of 0.25% of notional per trade, before any costs.
- Holds each trade for 3 days on average, which is about 9 settlements at an 8-hour interval.
Now assume, for the arithmetic only:
- Funding is positive at 0.01% per settlement throughout (the base interest component described above).
- Fees are 0.05% of notional on entry and 0.05% on exit.
- Slippage is 0.02% of notional on each side.
Per trade:
| Item | % of notional |
|---|---|
| Gross edge | +0.25% |
| Funding: 9 × 0.01% | −0.09% |
| Fees: 2 × 0.05% | −0.10% |
| Slippage: 2 × 0.02% | −0.04% |
| Net | +0.02% |
A spot-style backtest that models fees and slippage, but not funding, reports +0.11% per trade. With funding it's +0.02%, which is almost nothing. If the strategy held for 5 days instead of 3 (15 settlements), funding would be −0.15% and the net would be −0.04% per trade. The same trades lose money.
Funding can run well above the base component in strong uptrends, which is often exactly when a long-biased trend strategy is in a position.
Leverage makes the hole deeper in money terms. At 5× leverage on a $1,000 margin, the notional is $5,000. Each 0.01% settlement costs $0.50. Nine settlements cost $4.50 per trade, out of the same $1,000 of margin.
The opposite holds too: a short held through positive funding receives it, so leaving funding out understates short-biased strategies.
What about fees and slippage?
Futures fees are charged as a percentage of notional, with separate maker rates (your order rested on the book) and taker rates (your order crossed the spread). Binance publishes its tiers on the USDⓈ-M futures fee page. Rates depend on your VIP level and other discounts, and they change, so read the current figures there instead of copying a number from an old blog post.
For a backtest:
- Assume taker fees for market orders and stops, which is what most signal-driven fills are.
- Charge fees on notional. At 10× leverage, a 0.05% fee on notional is 0.5% of the margin you posted, on every side of every trade.
- Add slippage explicitly. A candle close is not a price you can trade at. Thin pairs and fast markets slip more. If a strategy only works with zero slippage, it doesn't work.
How do leverage, margin and liquidation work, and why must a backtest model them?
Initial margin is the collateral needed to open a position: roughly notional ÷ leverage. Maintenance margin is the minimum the exchange requires to keep it open. On Binance it comes from tiered brackets: larger positions fall into higher tiers with a higher maintenance rate. Binance shows the calculation in its liquidation price guide.
Binance's liquidation protocols say that liquidation is triggered when the mark price reaches the position's liquidation price, that traders should keep the margin ratio from reaching 100% to avoid it, and that a liquidated position pays a liquidation clearance fee.
A backtest without this model gets three things wrong:
- Stops beyond the liquidation price never fill. If your stop is 12% away and the liquidation price is 9% away, the exchange closes you first, and you pay the liquidation fee too.
- Account usage matters, not just leverage. In cross margin, the whole margin balance backs your positions. A 10× position using all the buying power is liquidated by a much smaller move than the same leverage on a quarter of the account.
- One bad wick ends the run. A candle-only backtest that "recovers" from a deep drawdown may have been liquidated halfway through it.
Leverage magnifies losses
Leverage can lose your whole margin on a single move. A backtest that survived on leverage tells you about one history, not about the next one.
Mark price vs last price: which one should a backtest use?
The last price is the most recent trade on the perpetual's order book. That's what ordinary candles are built from. The mark price is a price the exchange derives to resist manipulation and one-off wicks. On Binance, liquidation and the funding payment amount both use the mark price.
A backtest judged on last-price candles is usually harsher than the exchange: a brief wick in the last price can cross a liquidation level the mark price never reached, killing a strategy the exchange would have kept open. Use mark-price history for liquidation checks if you have it. If you don't, know which way your error points.
Is funding a signal or a cost?
It's both, and a backtest has to keep the two roles apart.
As a cost, funding is a cash flow on every position held through a settlement, whether or not your strategy looks at it. A backtest should charge it automatically.
As a signal, the funding rate is a read on positioning: persistently high positive funding means longs are paying to stay long. Traders use it as a crowding filter, a contrarian trigger, or momentum confirmation. Which works, if any, varies by coin, so test the sign before you assume it.
The look-ahead trap
A funding rate is only known once it's settled. Binance also shows a predicted rate for the current interval, which keeps moving until settlement.
The trap: your backtest aligns each funding value to the start of its 8-hour interval, so at 08:00 your strategy "sees" the rate that settles at 16:00. Any decision made between 08:00 and 16:00 now uses information from the future. The fake edge this produces can look strong, because funding is correlated with the price move during the interval it describes.
The fix is to make a settled rate readable only at or after its settlement time, and to hold that value unchanged until the next settlement.
A related trap is smoothing. An EMA or z-score of funding, stepped on every 1-minute candle, averages the same held value hundreds of times. Its "period" then counts minutes, not settlements. Step indicators over funding once per settlement.
What must a futures backtest model? The checklist
| Mechanic | What to model | What goes wrong if you skip it |
|---|---|---|
| Funding payments | The rates the exchange settled, charged on notional at each settlement held through | Long-biased strategies look better than they were; short-biased ones look worse |
| Funding interval changes | The actual settlement times, including pairs or periods that settled more often | Funding is undercounted during exactly the volatile stretches where it was highest |
| Fees | Maker/taker rates on notional, per side | Costs understated by the leverage factor |
| Slippage | An explicit cost on every fill | Fast-market entries and exits look cleaner than they were |
| Initial margin | Entries the account couldn't afford are refused | The backtest takes trades the exchange would have rejected |
| Maintenance margin | Tiered brackets per pair | Large positions survive moves that would have liquidated them |
| Liquidation | Checked every bar, before stops and signals, with a fee | Drawdowns that ended the account appear recoverable |
| Price for liquidation | Mark price where available | Liquidation timing differs from the exchange |
| Funding as a signal | Readable only after settlement; stepped per settlement | Look-ahead bias and indicators with the wrong period |
| Benchmark | Buy & hold of the same perpetual, paying funding | Strategy compared against a benchmark that carried for free |
How does Spera handle margin and funding?
Spera's backtests apply the futures rules by default. The details are in the manual's margin, liquidation, and funding page. In short:
- Funding is always charged on futures pairs. Quick and deep backtests, comparisons, portfolios and paper bots all charge the settlements Binance actually made, including changes of interval. The payment is position size × mark price × rate. A position pays a settlement only if it's held through it. Your strategy doesn't need a funding node for this to happen, and spot pairs never pay funding.
- Funding shows in the result. A futures run shows a Funding metric as a cash flow (negative means your closed trades paid). It's already inside each trade's PnL, like fees. The buy & hold benchmark pays funding too.
- If funding history can't be loaded, the run says so. It charges nothing and raises a "Funding was not charged" notice, so you know the result is too flattering for longs.
- Three margin modes: Cash (1×), Leverage, and Margin %. Leveraged modes can be liquidated. Leverage mode reads Binance's brackets for the pair when the run starts, and shows a Maintenance margin is approximate notice if it can't.
- Liquidation is checked on every bar with an open position, before take-profits and signals. A stop between the bar's open and the liquidation price fills first. Otherwise the position closes at the liquidation price (or the open, if price gapped through) and pays a liquidation fee.
- Mark price where it counts. Deep backtests, comparisons and portfolio legs judge liquidation on Binance's mark price. Quick backtests use the candle's last price, so a quick run can liquidate earlier than a deep run on the same window.
- Funding as a signal. The Funding Rate node emits the last settled rate and holds it until the next settlement. Indicators wired to it step once per settlement, so their period counts settlements, not candles.
Fees and slippage are set in Backtest settings, next to margin and sizing. Optional rails such as exposure caps, drawdown stops and margin-ratio limits live in the risk policy. Liquidation and funding are not rails, though, and they apply with or without a policy. For the quick-versus-deep workflow, see backtesting your strategy.
Try it on your own idea
Build a strategy in the Strategy Builder, switch the pair to a perpetual, set your leverage, and compare the Funding metric against the Total PnL.
FAQ
Do I pay funding if I close my position before the settlement?
No. According to Binance's funding FAQ, only positions open at the funding time pay or receive funding. Binance notes the actual settlement can be off by a few seconds, so a position closed right at the boundary is a timing question your backtest should resolve consistently.
Does leverage change how much funding I pay?
Yes, in money terms. Funding is charged on the position's notional value. At 5× leverage, the same margin controls five times the notional, so it pays five times the funding.
Why does my backtest show a liquidation when my stop should have closed the trade?
The stop was probably placed beyond the liquidation price. The exchange liquidates the position first, so the stop never fills. Lower the leverage, reduce the position size, or move the stop inside the liquidation price.
Should I backtest liquidation on the mark price or the last price?
Use the mark price if you have it, because that's what Binance liquidates on. Last-price candles include wicks the mark price may not have followed, so they tend to liquidate earlier than the exchange would.
Can I use the funding rate as a trading signal without look-ahead bias?
Yes, if each rate becomes readable only at or after its settlement and stays constant until the next one. Never align a rate to the start of the interval it describes, and step any indicator over it once per settlement.
Is a profitable futures backtest proof that a strategy will make money?
No. It's evidence about one history with the costs you modeled. Vary the date range and the pair, check the result with a holdout period, and paper trade it before risking money.
This guide is for education. It isn't financial or investment advice, and it doesn't recommend any strategy, product or exchange. Past performance, real or backtested, doesn't predict future results. Exchange rules quoted here are as of December 2026: check the linked Binance pages for the current versions.
Leveraged futures can lose more than you expect, quickly. Only trade with money you can afford to lose.