HomeDocumentationAPI Reference
Log In

Get Margin

Method Name


Calculates margin for a given subaccount and (optionally) a simulated state change. Does not take into account
open orders margin requirements.


subaccount_id integer required
simulated_position_changes array of objects
Optional, add positions to simulate a trade
simulated_position_changes[].amount string required
Position amount to simulate
simulated_position_changes[].instrument_name string required
Instrument name
simulated_position_changes[].entry_price string
Only for perps. Entry price to use in the simulation. Mark price is used if not provided.


id string or integer required
result object required
result.is_valid_trade boolean required
True if trade passes margin requirement
result.post_initial_margin string required
Initial margin requirement post trade
result.post_maintenance_margin string required
Maintenance margin requirement post trade
result.pre_initial_margin string required
Initial margin requirement before trade
result.pre_maintenance_margin string required
Maintenance margin requirement before trade
result.subaccount_id integer required



The above command returns JSON structured like this: