Skip to main content
POST
Replay Strategy

Replay Strategy

Runs a strategy against one resolved historical market, tick by tick. The replay engine evaluates your entry and exit rules against each snapshot, walks the historical order book for fills, and returns trades, PnL, drawdown, slippage, and an equity curve.
Strategy Replay requires a Pro, Pro Trial, or Enterprise subscription.

Request

Headers

string
required
Your API key. See Authentication.
string
required
Must be application/json.

Body parameters

string
required
Slug of a resolved market to replay, e.g. btc-updown-5m-1774975800.
string
required
Outcome token to trade. Allowed values: UP, DOWN.
array
required
Conditions that must all be true to enter a position. Each condition contains field, operator, and value.
array
required
Conditions where any true condition exits the position. Max-loss and market-end exits can also close the position.
number
required
Number of shares to simulate per trade. Must be between 1 and 10000.
number
default:"50"
Forced-exit drawdown threshold, from 1 to 100 percent. Defaults to 50 when omitted.
string
default:"MARKET"
Order type for the replay. Allowed values: MARKET, LIMIT. Defaults to MARKET when omitted.

Condition fields

Condition operators

Response

Replay responses use the standard API wrapper.
boolean
true when the replay completed successfully.
object
Replay result payload.
object
Market metadata for the replayed market.
object
Strategy summary including side, positionSize, orderType, entryConditionCount, and exitConditionCount.
object
Performance metrics including total_pnl, total_pnl_percent, max_drawdown, max_drawdown_percent, total_trades, winning_trades, losing_trades, win_rate, avg_trade_pnl, best_trade, worst_trade, time_in_position_pct, and final_market_outcome.
array
Entry and exit events. Each event includes type, reason, time, price, fill_price, shares, slippage, position_pnl, cumulative_pnl, and coin_price.
array
Sampled equity curve points containing time, pnl, unrealized_pnl, price, coin_price, and in_position.
integer
Number of historical snapshots evaluated by the replay engine.
string
Response timestamp.

Example

Response

Replays only work on resolved markets. Unresolved markets return MARKET_NOT_RESOLVED.

Errors