Backtester
How historical P&L is computed.
How It Works
When you open /pair/[symbol], the backtester pulls historical funding settlements from both legs for the selected period (default 3 days, up to 90 days where data is available). It computes the realized PnL of a delta-neutral position held continuously over that window.
- Fetch every funding settlement for both legs in the period
- For each settlement, compute (rate × position_size) and assign to the side that received the payment
- Sum to get total funding earned
- Subtract round-trip fees (entry + exit on both legs)
- Subtract estimated slippage from current order-book depth
- Display realized PnL, daily breakdown, win rate, max drawdown
Inputs
- Asset — picks both legs from current best long / best short
- Long leg / Short leg — swap any exchange via the dropdown
- Position size — USD per leg (default $10K). Slippage scales with size.
- Period — historical lookback (1D / 3D / 7D / 15D / 30D / 60D / 90D)
- Fee override — manually set taker bps per leg (auto-fills from exchange schedule)
Limitations
- Historical depth varies by venue. Newer adapters may have only 1-30 days available.
- Slippage is calculated from CURRENT order-book depth, not historical. If liquidity has changed significantly, the estimate may be optimistic or pessimistic.
- Virtual-liquidity DEXs (Reya, Variational, Hibachi, NADO, StandX, Ethereal) lack public order books; the backtester flags them with a "slippage not modeled" badge and excludes slippage from the cost calculation.
- Predicted-rate venues (Pacifica, OKX next-funding, dYdX next) use the predicted next rate rather than last realized rate for the live screener cell — historical PnL still uses realized settlements.