Skip to main content
POST
private/get_margin

Body

application/json
subaccount_id
integer<uint64>
required
Required range: x >= 0
simulated_collateral_changes
object[] | null

Optional collateral deltas to simulate deposits / withdrawals / spot trades.

simulated_position_changes
object[] | null

Optional position deltas to simulate perp / option trades.

Response

Success

Result of public/get_margin / private/get_margin: net margin (MtM minus requirement; positive = healthy) before and after the simulated changes, as USD decimal strings.

is_valid_trade
boolean
required

true when post-change initial margin passes, or the change is risk-reducing while maintenance margin stays healthy.

post_initial_margin
string
required
post_maintenance_margin
string
required
pre_initial_margin
string
required
pre_maintenance_margin
string
required
subaccount_id
integer<uint64>
required

0 for the public simulated-portfolio variant.

Required range: x >= 0