Subaccounts

private/get_subaccount

Changed on

Returns the complete portfolio for a single subaccount: its label, manager and risk-universe identifiers, margin type and liquidation status, aggregate valuation and margin figures (positions, collaterals, initial and maintenance margin, open-order margin) as decimal strings, plus the full lists of open orders, positions, and collateral balances. Margin, mark price, and Greek values are computed from live feed data at request time.

post/private/get_subaccount

Request

  • Base URL
    https://api.derive.xyz/v3
  • Auth
    API key in header X-DeriveWallet and API key in header X-DeriveTimestamp and API key in header X-DeriveSignature

Request body

GetSubaccountRequest required
subaccount_id, integer required

Response

Success

Subaccount required
collaterals, Collateral[] required
collaterals_initial_margin, string required
collaterals_maintenance_margin, string required
collaterals_value, string required
currency, string[] required
failed_to_fetch, boolean required

true if this subaccount's portfolio could not be loaded; such subaccounts are returned as placeholders by get_all_portfolios.

initial_margin, string required
is_under_liquidation, boolean required
label, string required
maintenance_margin, string required
manager_id, integer required
margin_type, string required
mm_credits, string required

MM credit from universe loss-socialization events: the socialized USDC debit lands on cash in full, and debit × (1 − write_down) is added back to maintenance margin while the 6-hour write-down runs. Events this subaccount has not yet realized contribute their expected credit, with the current subaccount value standing in for the MtM at realization. Zero while under auction — the credit is cleared when liquidation starts.

open_orders, Order[] required
open_orders_margin, string required

Uses the manager's params, as initial_margin does, even for a subaccount with a delayed-liquidation override. Order checks use the override, so the two can differ. This is rare: an override usually loosens maintenance margin only, and this is an initial-margin figure.

positions, Position[] required
positions_initial_margin, string required
positions_maintenance_margin, string required
positions_value, string required
projected_margin_change, string required

Change in maintenance_margin a minute past the account's next option expiry, once the options expiring by then settle into cash at today's forward. maintenance_margin + projected_margin_change < 0 signals liquidation right after that expiry. Excludes open orders; "0" for an account without an unexpired option.

risk_universe_id, integer required
subaccount_id, integer required
subaccount_value, string required
vault_deposit_holds, VaultDepositHold[] required

Changes

    • info

      the endpoint scheme security DeriveWallet AND DeriveTimestamp AND DeriveSignature was added to the API

    • info

      added the media type application/json for the response with the status

    • warning

      added the new max_crossed_orders enum value to the open_orders/items/cancel_reason response property for the response status