Prediction markets
Manifold-BT

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?

Yes33%No67%Illustration, not market data
0%25%50%75%100%JanFebMarAprMayJunJulAugSep
Market open
A share trades between 0 and 1 until the market resolves, then pays $1 or $0. The No side is the mirror of Yes, so the chart only needs one line.
1 minute
price history for a market's whole life
Every trade
size, price, side and time
$0
no key and no paid data
No book
Polymarket publishes no order book history

What Polymarket data you get

DataWhat you getLimit
1-minute pricesA market's whole life, resolved markets includedThe midpoint, with no volume or spread
TradesEvery trade, with size, price, side and timeRead by cursor, newest first. Fills under 0.01 shares are not served
Order book historyNot includedPolymarket 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.

will-x-happen/Yes
will-x-happen/No
Each outcome is its own symbol. The address is an example.
polymarket.py
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

Prices run from 0 to 1
In dollars per share, and each outcome is its own symbol.
Resolution settles the position
A position still open settles at what the share paid: $1, $0, or $0.50 on a voided market. No strategy can read the outcome beforehand.
Bars hold the midpoint
There is no bid, ask or volume in them. Add slippage to stand in for the spread.
Fees are yours to set
They depend on the market and the date, so nothing is assumed for you.

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.

will-donald-trump-win-the-2024-us-presidential-election/Yes, hourly bars, $10,000
Before feesAt 1% per fill
$4k$7k$10k$13kJan 2024Nov 2024
Real run, on the market's bars from the connector. Filled on the next bar at the midpoint.
+18.3%
before fees
−48.3%
at 1% per fill
41
round trips
0.4 ms
engine time

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.

400
resolved markets, 163 events
+1.8%
per market before fees, ± 0.5
+0.7%
per market at 1% per fill, ± 0.5
No edge
after costs, t = 1.4, under the bar of 2 set in advance

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.

ToolDataChoose it for
Manifold-BTFreeA local run, and the same code on crypto and futures
MarketLensTick-level L2 bookWhen the tick-by-tick order book is your edge
PolyBackTestBook depth, free tier then ProCrypto Up or Down markets
PolyTestOrder book snapshotsReplaying BTC, ETH, SOL and XRP markets
NautilusTraderThrough its Polymarket adapterGoing live from the code you tested
PyPI scriptsFree, partialAPI 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.

$pip install manifoldbt

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.