capturing live · since 21 May 2026

Backtest your Polymarket bot
on data you can't get anywhere else.

Lookahead-safe backtests across 4,900+ resolved markets, scored by Brier and calibration, live today. Plus a tick-level order-book archive we capture live that no API will sell you back. Your agent writes the Python and calls our MCP. You read the result.

Free to try, no card. One plan when you're ready: $59/mo.

polymarket_submit_bot
612 markets · 0.9s
Return
+19.9%
Brier
0.187
Edge
+214 bps
Markets
612
Calibrationpredicted vs actual

The moat is the data

Any agent can write the loop. None of them can record the book.

The reason a generic coding agent tells you to “just backtest it locally” is that for stocks and crypto the data is everywhere. For Polymarket it isn't. The order book is not a download. It exists only in the moment it streams, and then it is gone. We keep it.

Captured live, right now

A persistent collector holds an open connection to the CLOB market feed and writes full L2 snapshots, every placement and cancellation, and every trade print to cold storage. The archive deepens every hour it runs, which is the one asset a competitor can't clone after the fact.

Order-book archive: live since 21 May 2026.

L2 book · captured snapshotspread 2¢
0.614,200
0.606,800
0.599,100
0.585,400
0.5712,000
0.633,800
0.647,200
0.6510,400
0.664,600
0.678,800

Resolved, on-chain

Every outcome is stitched to its Polygon ConditionalTokens settlement, with disputed UMA resolutions flagged so your strategy can exclude them. No guessing which side paid out.

Honest fills

Taker fees applied per category with Polymarket's own formula. As the book archive matures, fills walk the real ladder at that timestamp instead of assuming the midpoint. Your backtested edge survives contact with the spread.

How it works

Describe the bot. Read the calibration. Decide.

01

Tell your agent the idea

backtest a fade-the-favorite bot on 2024 politics markets over $100k volume
02

It calls Bagtester

[mcp:bagtester] polymarket_submit_bot

03

You read the result

Return+19.9%
Brier0.187
Markets612

What comes back

A calibration curve, not a vibe.

Every backtest returns a structured result your agent can act on directly: Brier score, log-loss, the 10-bucket calibration curve, edge captured in basis points, by-tag PnL, the equity curve, and 11 prediction-market quality flags that tell you when not to trust the number.

  • Brier, log-loss and calibration on every run
  • PnL split by tag: politics is efficient, sports is fadeable
  • Quality flags for small samples and single-market dependence
  • One shared cash pool across every market
time-decay carrypolitics · 2024
sample run
Return
+19.9%
Brier
0.187
Markets
612
Hit rate
58%

equity, net of fees + spread

Plain Python

Ten lines. Your agent writes them.

A strategy is a class. The engine runs it across the filtered universe and hands back the structured result. Hand-write it or let the agent draft it from a sentence.

Your strategypython
from bagtester.polymarket import PolymarketStrategy

class TimeDecayCarry(PolymarketStrategy):
    """Buy cheap YES on long-dated markets, hold to resolution."""

    def on_market_update(self, ctx):
        yes = 0
        if ctx.portfolio.has_position(ctx.market.condition_id, yes):
            return
        price = ctx.current_price(yes)
        if price is None or price >= 0.20:
            return
        days = (ctx.market.effective_resolution_ts_ns
                - ctx.now_ns) / 86_400e9
        if days > 30:
            ctx.buy(yes, size_usdc=20.0)
Your agent calls Bagtestertext
> claude-code: backtest time-decay carry on
  2024 politics markets

[mcp:bagtester] polymarket_submit_bot
   ✓ ran 612 markets in 0.9s (vectorized)

result:
  total_return:  +19.9%
  brier_score:    0.187
  log_loss:       0.51
  edge_captured:  +214 bps
  markets:        612

next_steps:
  → polymarket_optimize_bot {threshold, days}
  → polymarket_walk_forward for out-of-sample

Correctness, not a config knob

A bot can't peek at the outcome. There is no flag to let it.

Lookahead bias is the way prediction-market backtests lie to you. We block it three ways, and none of them can be turned off.

01

No reading the future outcome

Touching market.final_outcome before the effective resolution timestamp raises LookaheadError. The result is not visible until time has passed it.

02

No trading after resolution

ctx.buy or ctx.sell after the effective resolution raises LookaheadError. You cannot fill an order in a market that has already settled.

03

No future prices

ctx.current_price(ts=future) raises LookaheadError. A strategy only ever sees the price as of now, never a bar that hasn't happened.

One plan

Free to see the data. $59 to ship on it.

The free tier exists so you can confirm the data is real before you pay. One paid plan, because real-money bot builders need the whole thing, not a feature ladder.

Free

$0

Confirm the data is real.

  • 12-hour price-series backtests
  • Up to 50 markets per backtest
  • Brier, calibration, quality flags
  • Midpoint fills
  • 1 API key
Start free

Recommended

Pro

$59/mo

The whole archive, full scale.

  • Full resolved universe, no per-backtest cap
  • Tick and L2 order-book data as it lands
  • Order-book fills, real spread
  • Parameter sweeps + walk-forward
  • Concurrent backtests
  • Spot cross-market data for crypto bots
  • Persistent strategy library
Get Pro

Full pricing details →

Common questions

FAQ

Why can't I just backtest a Polymarket bot locally for free?
You can write the loop. You can't get the data. Polymarket serves a coarse price series through its public API, but the order book, every resolved outcome stitched to its on-chain settlement, and the tick-level book history are not downloadable after the fact. Once a book update streams past the websocket it is gone unless someone was recording it. Bagtester records it. That is the part you cannot reproduce locally.
What data do I get today?
Lookahead-safe price-series backtests across 4,900+ resolved Polymarket markets since 2023, with resolutions confirmed against the Polygon ConditionalTokens contract. Coverage spans politics, sports, crypto, geopolitics, weather and pop-culture. The vectorized engine runs the full resolved universe in about 23 seconds.
What is the order-book archive you keep mentioning?
A persistent collector subscribes to Polymarket's CLOB market websocket and writes full L2 book snapshots, every order placement and cancellation, and every executed trade to cold storage continuously. It is capturing live now and the archive deepens every hour. As coverage matures it powers honest order-book fills: your taker order walks the real ladder that existed at that timestamp instead of assuming the mid.
How do you prevent lookahead bias?
Three independent enforcement vectors with no override flag. Reading market.final_outcome before the effective resolution timestamp raises LookaheadError. Calling ctx.buy or ctx.sell after the effective resolution raises LookaheadError. Asking for a future price raises LookaheadError. A strategy that trips one is a strategy bug, surfaced immediately, not silently absorbed.
What is the Brier score and calibration curve?
Brier score is the mean squared error between your bot's implied probability and the realized outcome. Lower is better. The calibration curve buckets your buy trades by the price you paid and plots the actual frequency that YES resolved in each bucket. A perfectly calibrated bot sits on the 45-degree line. The gap between your dots and that line is your edge, or your bleed.
Does my agent have to write the strategy?
It writes it from your prompt, and you are free to hand-write it too. A strategy is a Python class that extends PolymarketStrategy (event-driven, one callback per market update) or PolymarketVectorizedStrategy (a signal frame the engine walks with vectorized expressions, 20 to 50 times faster). Standard backtesting primitives apply: a shared cross-market cash pool, positions keyed by (market, outcome), fees and spread modeled per fill.
Can I pull in my own data?
Yes. For crypto markets you can align minute and tick spot history for BTC, ETH and SOL next to a Polymarket crypto market, so a bot can trade the prediction market off a spot signal. Bringing external series into a strategy is supported through the same context the engine hands your class.
Do you place trades on Polymarket?
No. Bagtester is a backtester. We never route orders. The output is a strategy you then run live yourself, with the confidence of a clean, lookahead-safe backtest behind it.

Find out if the edge is real before you fund the wallet.