Backtest Polymarket strategies in Python
Free 1-minute history for the whole life of any market, resolved ones included, plus every trade. It runs locally, on the same engine as crypto and futures.
Prediction market
Will X happen?
What Polymarket data you get
| Data | What you get | Limit |
|---|---|---|
| 1-minute prices | A market's whole life, resolved markets included | The midpoint, with no volume or spread |
| Trades | Every trade, with size, price, side and time | Read by cursor, newest first. Fills under 0.01 shares are not served |
| Order book history | Not included | Polymarket publishes none |
The limits of each route, with the free datasets and paid archives, are on Polymarket historical data, tested.
Polymarket backtest quickstart
All you need is the market’s slug. Your strategy stays the same.
store = mbt.ingest(provider="polymarket", symbol_id=1, interval="1h",
symbol="will-donald-trump-win-the-2024-us-presidential-election/Yes",
start="2024-01-05T00:00:00Z", end="2024-11-07T00:00:00Z")
result = mbt.run(strategy, config, store)How a binary market is simulated
A real Polymarket backtest
One simple rule on one known market, the 2024 US presidential election. Buy Yes when the hourly price sits two standard deviations under its 48-hour mean, and sell when it is back at the mean.
The fees turn it around. The 1% stands for today’s politics taker fee on a share near 75 cents, applied to a 2024 market as a stress test, and fills at the midpoint pay no spread. One market and one set of parameters prove nothing either way: this shows the tool, not an edge.
Scale it across resolved Polymarket markets
One market proves little, so we ran the same kind of rule over 400 resolved politics markets, with 10% of equity per entry and only between 5 and 95 cents. You give the slugs, since the connector only lists open markets. One sweep of 20 sets of parameters across all 400 takes about 1.7 s of engine time.
We chose the parameters on 186 markets resolved before July 2025, then read the 214 later ones once. After costs that is no edge we can claim: the gain is within two standard errors of zero, and fills at the midpoint pay no spread. Holding Yes from the start lost 0.3% over the same markets. The sample is the highest-volume markets, known only afterwards, so it leans towards the ones that mattered.
Use it from your AI agent
Connect your agent to the Manifold-BT MCP server. It reads the reference and writes a strategy that compiles, and you run the backtest on your own machine.
Compared with other Polymarket backtesting tools
Free data, a local run, one engine for Polymarket, crypto and futures, and thousands of markets in one sweep.
| Tool | Data | Choose it for |
|---|---|---|
| Manifold-BT | Free | A local run, and the same code on crypto and futures |
| MarketLens | Tick-level L2 book | When the tick-by-tick order book is your edge |
| PolyBackTest | Book depth, free tier then Pro | Crypto Up or Down markets |
| PolyTest | Order book snapshots | Replaying BTC, ETH, SOL and XRP markets |
| NautilusTrader | Through its Polymarket adapter | Going live from the code you tested |
| PyPI scripts | Free, partial | API wrappers and metrics, with no execution engine |
Access to Polymarket’s hosts is restricted in some countries, where the download fails with a network error.
FAQ
Keep reading
Run your first backtest
Install Manifold-BT and reproduce the backtest above in seconds. The Rust core runs years of bars sub-second so you can sweep parameters instead of waiting.
Polymarket and its logo belong to their owner. Manifold-BT is an independent backtesting library, not affiliated with or endorsed by Polymarket. It reads public data and places no bets or orders.