Paper trading

Set the simulation

Send any subset of the fields, or {"preset":"realistic"} for a ready-made configuration (a preset starts from the defaults, so it is a clean slate plus that venue), or {"reset":true}. Out-of-range values are REFUSED (400 bad_sim_field), never clamped, so a strategy is never measured under a setting you did not choose. Applies to positions opened from now on - a position keeps the maintenance margin, the fee rate and the exit crossing cost it was filled under, for life.

post/api/bot/v1/sim

Request

  • Base URL: https://marginpad.io
  • URL: https://marginpad.io/api/bot/v1/sim
  • Auth: API key in header X-API-Key

Request body

preset'frictionless' | 'realistic' | 'binance' | 'bybit' | 'okx' | 'hyperliquid' | 'thin_book' | 'brutal'

A ready-made configuration. Starts from the defaults, so it is a clean slate plus that venue.

resetboolean

true = back to the engine defaults.

start_balance_usdnumber

The book your results are measured against.

margin_enforcedboolean

true = an open over free margin is refused 402 insufficient_margin, as a venue refuses it.

leverage_maxnumber

Your own leverage ceiling. 0 = the per-market cap.

max_notional_usdnumber

Your own ceiling on one position’s notional. 0 = none.

slippageboolean

Fill against yourself the way walking a real book does.

slippage_bpsnumber nullable

Your own crossing cost in basis points instead of our measured table. null = the table.

impact_bps_per_100knumber

Extra basis points per $100,000 of notional, because size walks further down the book.

exit_slippageboolean

Pay the crossing cost on the way out too. A stop, take-profit or liquidation still fills at its own level.

latency_msnumber

Your order is in flight this long, and the price is re-read afterwards.

partial_fillsboolean

Allow a market order to fill less than it asked for.

min_fill_pctnumber

The worst fill ratio with partial_fills on.

reject_rate_pctnumber

Share of opens refused 503 venue_rejected on purpose.

taker_bpsnumber nullable

Your own per-side fee in basis points. null = the venue from POST /v1/fees, or our class rate.

fundingboolean

false = never charge funding, which is how you separate an execution edge from a carry edge.

funding_multnumber

Scale the real 8-hourly funding rate.

margin_venuestring

Whose published maintenance-margin rate decides where liquidation sits. ’’ = MarginPad’s 0.5%.

margin_tiersboolean

Raise maintenance margin with size, so a large position liquidates sooner.

mmr_pctnumber nullable

Your own maintenance margin, beating margin_venue.

Response

{ ok, profile, changed, preset_applied, effective }

Changes

No recorded changes to this operation across all 1 revision of this API.