Subaccounts

private/get_all_portfolios

Returns the complete portfolio (same shape as get_subaccount) for every subaccount owned by the given wallet, including valuations, margin figures, open orders, positions, and collaterals. If an individual subaccount's portfolio cannot be built, it is returned as a placeholder entry with failed_to_fetch set to true rather than failing the whole request.

post/private/get_all_portfolios

Request

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

Request body

walletstring required

20-byte Ethereum address as a 0x-prefixed lowercase hex string.

Response

Success

collaterals_initial_marginstring required
collaterals_maintenance_marginstring required
collaterals_valuestring required
currencystring[] required
failed_to_fetchboolean required

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

initial_marginstring required
is_under_liquidationboolean required
labelstring required
maintenance_marginstring required
manager_idinteger required
margin_typestring required
mm_creditsstring 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 15-minute 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_marginstring 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_initial_marginstring required
positions_maintenance_marginstring required
positions_valuestring required
projected_margin_changestring 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_idinteger required
subaccount_idinteger required
subaccount_valuestring required

Changes

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