Skip to main content
POST /account/simulate/{user_id} is the trade simulation. It is non-mutating: it clones the sub-account, applies any pending trading account transfers, applies a synthetic trade, and returns projected margin fields. The simulated order is not reduce-only aware. Do not use simulate to prove a reduce-only order will pass. liquidation_price is the estimate for the traded asset’s margin position after the trade, computed the same way as in /positions. It is absent when that position is flat, when no price in that position’s losing direction would liquidate the account, or when the estimate cannot be computed.

Raw simulate

Supported scenarios:

tpluspy

OrderBookClient.init_trade_simulation returns a typed projection.

Worked example

Example verified from the simulate handler tests:
The paired sell example with the same starting state returns available_margin = 9000, mm_surplus = 9000, utilized_margin = 0, account_leverage = 0.5, and margin_required = 1000.

Liquidation monitoring

Use account margin endpoints and the authenticated at-risk stream, not simulate liquidation price:
Client indicators: