preview_order
Simulate an order to see its margin, equity, and fee impact before placing it. Review projected portfolio changes without sending anything to the matching engine.
Instructions
Preview an order without submitting it: projects the margin, equity, and fee impact of the order. Takes the same arguments as create_order. Nothing reaches the matching engine. Requires API credentials.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Order side. | |
| size | Yes | Order quantity in base units, as a positive decimal string (> 0). | |
| type | Yes | Order type. `limit` and `market` are unconditional. `stop_limit` / `stop_market` fire when the mark price crosses `trigger_price` in the adverse direction (stop-loss); `take_profit_limit` / `take_profit_market` fire on the favorable direction. `trailing_stop` fires a market order once the mark retraces from its best-seen extreme by `trailing_offset_bps`; `trailing_limit` fires the same way but rests a limit order priced off the fire price by `limit_offset_bps`. Field requirements: limit-family (`limit`, `stop_limit`, `take_profit_limit`) require `price`; stop / take-profit types require `trigger_price`; trailing types require `trailing_offset_bps`. | |
| price | No | Limit price as a positive decimal string (> 0). Required for limit-family orders (`limit`, `stop_limit`, `take_profit_limit`); must be omitted for market, stop_market, take_profit_market, and trailing orders (which are priced by the engine or computed at fire time). | |
| market_id | Yes | Market id, e.g. "BTC-USDX-PERP". | |
| reduce_only | No | If true, only reduces an existing position. | |
| time_in_force | No | Time in force. Defaults to GTC for limit, IOC for market. `PostOnly` rejects the order if it would take liquidity on entry, guaranteeing it rests as a maker. | |
| trigger_price | No | Trigger threshold as a positive decimal string (> 0). Required for stop and take-profit orders (`stop_limit`, `stop_market`, `take_profit_limit`, `take_profit_market`): the order activates once the mark price crosses it — adversely for stops, favorably for take-profits. Must be omitted for other order types. | |
| limit_offset_bps | No | Fire-time limit-price offset in basis points (`trailing_limit` only; required together with `trailing_offset_bps`). The rested limit sits at fire_price * (1 + offset) for buys / * (1 - offset) for sells; 0 rests exactly at the fire price. | |
| trailing_offset_bps | No | Trailing trigger offset in basis points (1 bp = 0.01%). Required for trailing orders (`trailing_stop`, `trailing_limit`); must be omitted otherwise. Fires once the mark price retraces from its best-seen extreme by this many bps (0 fires at the first evaluation). |