Method Name
private/get_margin
private/get_marginCalculates margin for a given subaccount and (optionally) a simulated state change. Does not take into account
open orders margin requirements.
Required minimum session key permission level is read_only
Parameters
subaccount_id
integer required |
simulated_collateral_changes
array of objects |
simulated_collateral_changes[].
amount
string required |
simulated_collateral_changes[].
asset_name
string required |
simulated_position_changes
array of objects |
simulated_position_changes[].
amount
string required |
simulated_position_changes[].
instrument_name
string required |
simulated_position_changes[].
entry_price
string |
Response
id string or integer required |
result object required |
result.
is_valid_trade
boolean required |
result.
post_initial_margin
string required |
result.
post_maintenance_margin
string required |
result.
pre_initial_margin
string required |
result.
pre_maintenance_margin
string required |
result.
subaccount_id
integer required |
Example
{request_example_shell}{request_example_javascript}{request_example_python}The above command returns JSON structured like this:
{response_example_json}