Backtesting

Polymarket Slippage Backtesting: Simulate Realistic Fills

Backtest Polymarket strategies with slippage by consuming historical order book depth instead of assuming midpoint or last-price fills.

Polymarket slippage backtesting measures what your strategy would have paid after crossing the spread and consuming available depth. This is critical because prediction market order books can be thin.

Bad Fill Assumptions

  • Buying at midpoint
  • Selling at midpoint
  • Ignoring partial fills
  • Assuming the same liquidity exists for every order size

Better Slippage Model

  1. For a buy, walk the ask ladder until the order size is filled.
  2. For a sell, walk the bid ladder until the order size is filled.
  3. Record average fill price and unfilled quantity.
  4. Repeat for entry, exit, and stop logic.

Metrics to Track

MetricPurpose
Expected vs filled priceMeasures execution drag
Unfilled sizeShows capacity limits
Spread paidSeparates spread cost from depth cost
Slippage by market ageFinds fragile time windows

Related Resources