Guide

Choosing a fill model for Polymarket backtests

A backtest is only as honest as the fills it assumes. On Polymarket the correct model depends on the asset: a Bitcoin market absorbs size at the touch, a Zcash market does not. This guide covers the fill models the archive supports and when each is defensible.

What this guide covers

  • Measured 3-day top-of-book depth spans 2,044 (zec) to 57,147 (btc) - a 28x range
  • Backtest AI accepts a taker_fee and a trade_lag_seconds per strategy
  • The archive stores full L2 books every 250ms, so fills can be replayed level by level
  • A mid-price fill model overstates profitability on every measured asset

The three fill models

There are three common assumptions. Mid-fill assumes every order executes at the midpoint - the most flattering and least realistic. Touch-fill assumes execution at the best resting price on the opposite side, which is realistic for small size. Walk-the-book consumes resting levels in order until the order is filled, which is the only model that respects depth.

Mid-fill is defensible for one purpose: a quick sanity check that a signal has any edge at all. It should never appear in a number you publish. Touch-fill is a reasonable default for retail-sized orders on liquid assets. Walk-the-book is the default for anything large or for thin assets.

Why asset choice changes the model

Measured 3-day top-of-book liquidity runs from 2,044 contracts on Zcash to 57,147 on Bitcoin. A 500-contract order is a rounding error on Bitcoin and a book-moving event on Zcash. The same strategy, backtested with the same fixed fill model, will look profitable on one asset and impossible on the other purely because of depth.

This is the single most common source of inflated backtest results on prediction markets. Set the fill model per asset, using the measured depth for that asset - not a constant borrowed from Bitcoin.

Measured 3-day top-of-book depth by asset (2026-10-17)
AssetDepthSuggested default fill
btc57,147touch-fill
eth26,844touch-fill
sol18,132walk-the-book
xrp16,649walk-the-book
doge12,054walk-the-book
bnb11,710walk-the-book
hype5,390walk-the-book
zec2,044walk-the-book

Modeling the taker fee and trade lag

Every taker order pays the market's fee, and the archive's backtester exposes it as taker_fee on the strategy so it is applied consistently across every simulated trade. Omitting it is the second-most common inflation: a strategy that turns over frequently can be profitable pre-fee and unprofitable after.

trade_lag_seconds models the delay between your signal firing and the order reaching the book. On a 250ms archive, a lag of one second can span several book updates, and on a fast market that is where the edge lives or dies. Set it to at least the honest latency of your real system.

Queue position and partial fills

The archive stores level-by-level depth, so a walk-the-book model can consume it exactly. What the data cannot tell you is your place in the queue at a given price, because that depends on when your order arrived relative to others. Assume the worst - that you are behind the size already resting - unless your strategy only ever takes liquidity.

For taker strategies, queue position is irrelevant: you cross the spread and pay the fee. For maker strategies, it dominates, and any backtest that fills a resting order the instant the price touches it is optimistic. If your strategy rests orders, state the queue assumption explicitly.

Code examples

# Walk-the-book fill over archived L2 levels.
def fill_price(levels, size, side):
    remaining = size
    cost = 0.0
    for price, qty in levels:
        take = min(remaining, qty)
        cost += take * price
        remaining -= take
        if remaining <= 0:
            break
    if remaining > 0:
        return None  # not enough depth: order would rest
    return cost / size

def taker_cost(price, size, fee):
    return price * size * (1 + fee)

Free tier

The Starter plan is free, includes order books, prices, and metrics at 250ms resolution, with 3 days of history, 60 requests/min, 1,000/day, 1 free AI backtest, and 3 strategy backtests. No credit card required.

Paid data windows from $19/mo extend history to 30–120 days at higher throughput. Backtest AI add-on is +$19/mo or standalone at $29/mo.

FAQ

What is the most realistic fill model?

Walk-the-book, because it consumes resting depth in order and accounts for thin books. Touch-fill is acceptable for small orders on liquid assets like BTC and ETH; mid-fill should only be used as a sanity check.

Why can't I use the same fill model on every asset?

Because depth varies 28x across the measured assets, from 2,044 on ZEC to 57,147 on BTC. A fixed model overstates fills on thin assets and understates the effort on liquid ones.

Does the backtester apply the taker fee?

Yes if you set taker_fee on the strategy. Omitting it inflates results for high-turnover strategies, which is why it should always be set.

How do I model my queue position?

You cannot, from the archive alone - queue position depends on arrival order. For taker strategies it does not matter; for maker strategies assume you are behind the resting size.