Subaccounts

public/get_margin

Calculates net initial and maintenance margin for a fully simulated portfolio under a chosen margin type (SM or PM2; market selects the currency a PM2 manager must cover), optionally with a further simulated state change layered on top. Values are net margin — mark-to-market value minus the requirement — so positive means healthy. Does not take open-order margin into account.

post/public/get_margin

Request

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

Request body

margin_typestring required

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

marketstring nullable

Currency the PM2 manager must cover; required for PM2.

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.