Polymarket Market Replay API: Test Strategies on Resolved Markets
Replay entry and exit rules against a resolved Polymarket market and inspect simulated fills, PnL, drawdown, and slippage.
The PolyHistorical market replay API evaluates a strategy against one resolved market, tick by tick. It checks entry and exit conditions against historical snapshots, simulates fills by walking the order book, and returns performance metrics and trade events.
Replay Requirements
- Choose a resolved market by its market slug.
- Select the
UPorDOWNoutcome. - Specify entry conditions, exit conditions, and a position size from 1 to 10,000 shares.
- Choose market or limit order simulation and an optional maximum-loss threshold.
Strategy Replay requires a Pro, Pro Trial, or Enterprise subscription. Entry conditions must all be true. Any configured exit condition can close the position; max-loss and market-end exits can also close it.
Example Request
curl -X POST "https://api.polyhistorical.com/v1/replay" \\
-H "X-API-Key: YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"marketSlug": "btc-updown-5m-1774975800",
"side": "UP",
"entryConditions": [
{"field": "price_up", "operator": "<", "value": 0.40},
{"field": "spread", "operator": "<", "value": 0.08}
],
"exitConditions": [
{"field": "price_up", "operator": ">=", "value": 0.60}
],
"positionSize": 100,
"maxLossPercent": 25,
"orderType": "MARKET"
}'
What the Response Contains
The response includes a strategy summary, total PnL, win rate, maximum drawdown, average and individual trade results, fill prices, slippage, and sampled PnL-curve points. Review the simulated fill price rather than assuming an order executes at the signal price.
Interpret Results Carefully
A replay evaluates the conditions and execution assumptions you submit for one resolved market. It does not establish that a strategy will be profitable in future markets. Test across multiple markets, account for fees and operational constraints, and keep strategy selection separate from evaluation data to reduce overfitting.