---
title: "private/get_subaccount"
method: POST
path: "/private/get_subaccount"
tags: ["Subaccounts"]
---

# private/get_subaccount

`POST /private/get_subaccount`

## Request

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

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.

## Request body

- GetSubaccountRequest
  - `subaccount_id` integer, required

## Response `200`

Success

- Subaccount
  - `collaterals` Collateral[], required
    - `amount` string, required
    - `amount_step` string, required
    - `asset_name` string, required
    - `asset_type` string, required
    - `average_price` string, required
    - `average_price_excl_fees` string, required
    - `creation_timestamp` integer, required
    - `cumulative_interest` string, required
    - `currency` string, required
    - `delta` string, required
    - `delta_currency` string, required
    - `initial_margin` string, required
    - `maintenance_margin` string, required
    - `mark_price` string, required
    - `mark_value` string, required
    - `open_orders_margin` string, required
    - `pending_interest` string, required
    - `realized_pnl` string, required
    - `realized_pnl_excl_fees` string, required
    - `total_fees` string, required
    - `unrealized_pnl` string, required
    - `unrealized_pnl_excl_fees` string, 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
    - `algo_duration_sec` integer, nullable
    - `algo_num_slices` integer, nullable
    - `algo_slices_completed` integer, nullable
    - `algo_type` 'twap', nullable
    - `amount` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `average_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `cancel_reason` '' | 'user_request' | 'mmp_trigger' | 'insufficient_margin' | 'signed_max_fee_too_low' | 'cancel_on_disconnect' | 'ioc_or_market_partial_fill' | 'session_key_deregistered' | 'subaccount_withdrawn' | 'compliance' | 'trigger_failed' | 'validation_failed' | 'algo_completed' | 'max_crossed_orders'
    - `creation_timestamp` integer, required
    - `direction` 'buy' | 'sell', required
    - `extra_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `filled_amount` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `instrument_name` string, required
    - `is_transfer` boolean, required
    - `label` string
    - `last_update_timestamp` integer, required
    - `limit_price` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `max_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `mmp` boolean, required
    - `nonce` string, required
    - `order_fee` string, decimal, required: Decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits; a string or JSON number is accepted
    - `order_id` string, required
    - `order_status` 'open' | 'filled' | 'rejected' | 'cancelled' | 'expired' | 'untriggered' | 'algo_active', required
    - `order_type` 'limit' | 'market', required
    - `quote_id` string, uuid, nullable, required: Optional UUID v4 string
    - `replaced_order_id` string, uuid, nullable, required: Optional UUID v4 string
    - `signature` string, required
    - `signature_expiry_sec` integer, required
    - `signed_limit_price` string, decimal, nullable, required: Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
    - `signer` string, required
    - `subaccount_id` integer, required
    - `time_in_force` 'gtc' | 'post_only' | 'fok' | 'ioc', required
    - `trigger_price` string, decimal, nullable, required: Optional decimal string of the human value (e.g. `"1.5"`), up to 12 fractional digits, or null; a string or JSON number is accepted
    - `trigger_price_type` 'mark' | 'index', nullable
    - `trigger_reject_message` string, nullable
    - `trigger_type` 'stoploss' | 'takeprofit', nullable
  - `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
    - `amount` string, required
    - `amount_step` string, required
    - `average_price` string, required
    - `average_price_excl_fees` string, required
    - `creation_timestamp` integer, required
    - `cumulative_funding` string, required
    - `delta` string, required
    - `gamma` string, required
    - `index_price` string, required
    - `initial_margin` string, required
    - `instrument_name` string, required
    - `instrument_type` 'option' | 'perp' | 'erc20', required: Asset type of the instrument: `"option"`, `"perp"`, or `"erc20"`.
    - `leverage` string, nullable
    - `liquidation_price` string, nullable
    - `maintenance_margin` string, required
    - `mark_price` string, required
    - `mark_value` string, required
    - `net_settlements` string, required
    - `open_orders_margin` string, required: Uses the same params as `initial_margin`: the manager's, even for a subaccount with a delayed-liquidation override, unless `public/margin_watch` asks for the override.
    - `pending_funding` string, required
    - `realized_pnl` string, required
    - `realized_pnl_excl_fees` string, required
    - `theta` string, required
    - `total_fees` string, required
    - `unrealized_pnl` string, required
    - `unrealized_pnl_excl_fees` string, required
    - `vega` string, 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
    - `amount` string, required
    - `asset_name` string, required
    - `currency` string, required
    - `vault_id` integer, required

## Other responses

- `default`: JSON-RPC error (see Error Codes)

## Changes

- **2026-10-20** `0c500202be49`: 2 info
  - the endpoint scheme security `DeriveWallet AND DeriveTimestamp AND DeriveSignature` was added to the API
  - added the media type `application/json` for the response with the status `default`
- **2026-10-14** `bbc792e18f1a`: 1 warning
  - added the new `max_crossed_orders` enum value to the `open_orders/items/cancel_reason` response property for the response status `200`

[Operation history](https://skmtc.dev/lyra/apis/derive-v3-api/changes/private/get_subaccount/post.md)

---

[API](https://skmtc.dev/lyra/apis/derive-v3-api.md) - [All operations](https://skmtc.dev/lyra/apis/derive-v3-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lyra/apis/derive-v3-api/revisions/415f8a73b10c?raw)
