Backtest your Polymarket bot on historical order books.
Tick-level order book history, backtesting SDK, and structured analytics for Polymarket. From pip install to first backtest in 60 seconds.
Capabilities
Ready to start trading?
Millisecond replay
Replay the full order book at millisecond resolution. Every level, every tick, nothing interpolated.
Real-depth backtesting
Backtest against historical books with real queue priority, latency, and slippage.
Probability surfaces
Extract implied distributions and survival curves across multi-outcome markets.
Self-healing collection
Verified against CLOB ground truth with automatic reseed on drift and redundant connections.
Explore
See the data. Build with it.
Replay tick-level order books or backtest strategies against real historical data.
Failed to load order book data
Quick Start
Billions of ticks. One SDK.
Hunt edges, not bugs. Tick-by-tick replay with simulated fills, fees, and latency.
from marketlens import MarketLens, Strategy
class AskHeavyFader(Strategy):
def __init__(self):
self._entered = False
def on_market_start(self, ctx, market, book):
self._entered = False
def on_trade(self, ctx, market, book, trade):
if book.imbalance(5) < -0.2 and not self._entered:
ctx.buy_no(size=100)
self._entered = True
client = MarketLens("<API KEY>")
result = client.backtest(
AskHeavyFader(), "btc-up-or-down-5m",
after="2026-04-15T12:00:00Z", before="2026-04-15T18:00:00Z",
initial_cash=10_000, data_dir="data",
)
result.save("runs/btc-fader", overwrite=True)Coverage
What's in the box?
Every product type tracked continuously with full L2 depth.
Binary
Will X go up or down?
Crypto · Indices · FX · Commodities · Equities
Multi-Strike
What will X close at?
Crypto · Equities
Barrier / Hit-Price
Will X hit a specific price level?
Crypto · Commodities
Macro & Economic
Central banks, economic data, earnings
Rates · Economic
One-off markets are not collected. Every series listed above recurs on a fixed schedule, producing sequential instances you can backtest against.
Pricing
Simple, transparent pricing.
All tiers access the same data and endpoints. Limits are per-user, aggregated across keys.
Free
Explore the data
- ✓180 requests / min
- ✓1M events / day
- ✓1 API key
- ✓Bulk exports included
- ✓Full history & SDK access
Pro
For researchers & traders
- ✓3,600 requests / min
- ✓5B events / day
- ✓5 API keys
- ✓Bulk exports included
- ✓Priority support
Enterprise
For teams & trading desks
- ✓10,800 requests / min
- ✓Unlimited events / day
- ✓25 API keys
- ✓Bulk exports included
- ✓Dedicated support