Back to blog
    Guides·July 26, 2026·11 min read·By Predexon Team

    How to Backtest a Prediction Market Strategy (Properly)

    Most prediction market backtests are fiction: sampled prices, no book depth, no queue modeling. Here's what a rigorous backtest needs and how to build one.


    Backtesting equities strategies is a solved problem — decades of clean OHLCV data, mature libraries, well-understood pitfalls. Prediction markets are different: prices live in cents, liquidity is thin and lumpy, markets are born and die in weeks, and the data most people backtest on is far too coarse to trust. This guide covers what actually goes wrong and how to do it right.


    Why most prediction market backtests are fiction

    They backtest on sampled prices. A time series of hourly midpoints tells you what the market thought, not what you could have done. In a market quoted at 64¢/65¢ with $900 at the touch, "buy at 64" is a fantasy for any size — your fill price depends on depth you can't see in a price series.

    They ignore the spread. Prediction market spreads of 1–3¢ on a contract worth ≤100¢ are enormous in relative terms. A strategy that "earns" 2¢ per round trip on sampled midpoints loses money the moment you model crossing the spread.

    They ignore queue position. Passive strategies live or die on when your limit order would have filled. That depends on where you'd have sat in the queue and how much volume traded through your level — unknowable without the full order-event stream.

    They survive on survivorship. Resolved markets with clean narratives get studied; the weird ones — early resolutions, disputed outcomes, dead liquidity — quietly drop out of datasets, flattering every result.

    The data hierarchy

    From weakest to strongest basis for a backtest:

    1. Sampled prices (hourly/daily midpoints) — fine for directional research on forecast accuracy, useless for execution
    2. Trade tape — real fills with sizes; lets you model participation but not what was quoted
    3. Book snapshots — depth at intervals; better, but events between snapshots are invisible
    4. The full tick stream — every placement, update, cancel, and fill; lets you reconstruct the book at any instant and simulate your order in it

    Level 4 is the standard in traditional market microstructure, and it's what tick-level orderbook history provides for Polymarket, Kalshi, and Opinion: every book event with millisecond timestamps, downloadable as Parquet.

    A rigorous backtest loop

    1. Reconstruct the book from raw ticks up to each decision point — never peek past it
    2. Generate the signal using only information available at that timestamp (beware resolution knowledge leaking in via market metadata)
    3. Simulate the order against the actual book: cross the spread and walk the depth for takers; for makers, insert into the queue at your level and fill only as observed volume trades through it
    4. Model costs: the spread you crossed, and adverse selection — the fills you *do* get as a maker cluster on the wrong side of news
    5. Account for resolution risk: hold-to-resolution strategies must model disputed and early resolutions, not assume clean settlement
    import pandas as pd
    
    # One market-month of raw Polymarket ticks (from a quoted Parquet download)
    ticks = pd.read_parquet("polymarket_fed_sept_raw.parquet")
    
    # Reconstruct top-of-book at each event
    book = ticks.pipe(build_book)          # your book-builder over placements/cancels/fills
    signal_times = book.resample("1min").last().index
    
    for t in signal_times:
        snapshot = book.asof(t)            # the book exactly as it stood
        decide_and_simulate(snapshot)      # walk depth / queue-model against later ticks

    The point of raw ticks: build_book is possible. With sampled data there is nothing to build.

    Practical notes

    • Start with one market class (e.g. Fed meetings) — microstructure differs wildly between a $40M election market and a $50k weather market
    • Quote slices before you buy: Predexon's tick API quotes any slice for free, so you can scope a research dataset to a few dollars
    • Pair with trade/price history for context: Polymarket trades and prices back to 2020 give you the long-horizon signal layer; ticks (captured since January 2026) give you the execution layer
    • Validate against the tape: your simulated fills should never exceed volume that actually traded at your level

    Getting started

    1. Sign up at dashboard.predexon.com — $50 in free data credits with a payment method
    2. Quote a market slice via GET /v2/data/ticks/quote (free)
    3. Download Parquet, load it into pandas/Polars/DuckDB, and build your book

    Related: Polymarket orderbook history · Kalshi orderbook history · full docs

    Ready to get started?

    Get an API key and start querying prediction market data in minutes — free tier, no credit card.