Backtesting

Polymarket Backtesting

Backtest Polymarket strategies with historical order book data, realistic fills, slippage, spread costs, and resolved market outcomes.

Polymarket backtesting requires replaying the data a strategy would have seen at the time. For prediction markets, that means historical order book snapshots, bid/ask spread, available depth, and final resolution outcomes.

Why Price-Only Backtests Are Weak

Midpoint or last-price backtests can validate directional logic, but they cannot prove that a trade was executable. Realistic Polymarket backtesting should simulate entries and exits against historical bid and ask levels.

Backtesting Inputs

  • Resolved markets with known outcomes.
  • Timestamped order book snapshots.
  • Full bid and ask depth for UP and DOWN tokens.
  • Reference price context for crypto Up/Down markets.
  • Risk metrics such as PnL, drawdown, win rate, and fill quality.

Workflow

  1. Choose a market type and date range.
  2. Fetch historical snapshots with order book depth.
  3. Replay snapshots chronologically.
  4. Run strategy rules against each snapshot.
  5. Simulate fills using actual depth and score against resolution.

Related Resources

Core Polymarket Data Resources