Skip to main content
POST
public/get_margin

Body

application/json
margin_type
string
required

SM (standard margin) or PM2 (portfolio margin).

simulated_collaterals
object[]
required

Collaterals of the simulated portfolio.

simulated_positions
object[]
required

Positions of the simulated portfolio.

market
string | null

Currency the PM2 manager must cover; required for PM2.

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