Backtesting

Polymarket Backtesting API: Replay Strategies with Historical Books

Use a Polymarket backtesting API to replay resolved BTC, ETH, and SOL Up/Down markets with historical order books and realistic fills.

A Polymarket backtesting API should let you replay past markets using the data your strategy would have seen at the time. PolyHistorical provides historical snapshots for resolved Up/Down markets so you can test entries, exits, liquidity filters, and slippage assumptions.

What the API Provides

  • Market discovery by coin, timeframe, and resolution status
  • Historical snapshots ordered by timestamp
  • Optional full order book depth on every snapshot
  • UP and DOWN token prices
  • Reference prices and final market outcome

Backtesting API Flow

1. GET /v1/markets?coin=BTC&market_type=5m&resolved=true
2. Pick a market slug
3. GET /v1/markets/{slug}/snapshots?include_orderbook=true
4. Replay snapshots in timestamp order
5. Simulate fills against orderbook_up or orderbook_down

When to Use an API Instead of a Static Dataset

An API is best when you are iterating on filters, testing new market windows, or integrating with a live research system. Static downloads are better when you need to process a very large fixed slice offline. PolyHistorical supports both API-first workflows and bulk export patterns.

Execution-Aware Strategy Checks

  • Did enough size exist at the ask when the strategy entered?
  • Would the trade have crossed multiple price levels?
  • Was the spread too wide for the expected edge?
  • Did liquidity vanish near market close?
  • How did PnL change after accounting for actual fills?

Related Resources