Method Name
private/get_margin
private/get_margin
Calculates margin for a given subaccount and (optionally) a simulated state change. Does not take into account
open orders margin requirements.
Parameters
subaccount_id
integer
required
Subaccount_id |
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. |
Response
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
Subaccount_id |
Example
{request_example_shell}
{request_example_javascript}
{request_example_python}
The above command returns JSON structured like this:
{response_example_json}