Subaccounts

private/get_margin

Calculates net initial and maintenance margin for a subaccount before and after an optional simulated state change (position and/or collateral deltas), and whether that change would pass the margin requirement. Values are net margin — mark-to-market value minus the requirement — so positive means healthy. Does not take open-order margin into account. Margins use the subaccount's manager's params. Set is_delayed_liquidation to use its delayed-liquidation override instead, as order checks do; the request is rejected for a subaccount without one.

post/private/get_margin

Request

  • Base URL: https://api.derive.xyz/v3
  • URL: https://api.derive.xyz/v3/private/get_margin
  • Auth: none declared

Request body

is_delayed_liquidationboolean

true margins under the subaccount's delayed-liquidation override, as order checks do. Rejected for a subaccount without one.

subaccount_idinteger required

Response

Success

is_valid_tradeboolean required

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

post_initial_marginstring required
post_maintenance_marginstring required
pre_initial_marginstring required
pre_maintenance_marginstring required
subaccount_idinteger required

0 for the public simulated-portfolio variant.

Changes

No recorded changes to this operation across all 1 revision of this API.