> ## Documentation Index
> Fetch the complete documentation index at: https://v3.docs.derive.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Get full portfolio for a subaccount

> 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.



## OpenAPI

````yaml /openapi.json post /private/get_subaccount
openapi: 3.1.0
info:
  title: Derive v3 API
  version: 0.2.0
  description: JSON-RPC 2.0 methods, served over WebSocket and HTTP POST.
servers:
  - url: https://api.derive.xyz/v3
    description: Production (HTTP POST base)
  - url: https://testnet.api.derive.xyz/v3
    description: Testnet (HTTP POST base)
security: []
tags:
  - name: Subaccounts
    description: >-
      List, inspect, and label subaccounts, portfolios, positions, and
      collateral.
  - name: Session Keys
    description: Register, edit, and list delegated signing keys.
  - name: Account
    description: Wallet-level account information and settings.
  - name: Orderbook
    description: Place, replace, cancel, and query orders, trigger orders, and algos.
  - name: RFQ
    description: 'Request-for-quote: send RFQs, quote, and execute block trades.'
  - name: Vault Shareholders
    description: >-
      Deposit into and withdraw from vaults, and track shares, requests, and
      performance.
  - name: Vault Curators
    description: >-
      Create and operate curated vaults: settle deposit and withdrawal requests,
      and manage vault metadata.
  - name: History
    description: >-
      Per-account historical records: orders, trades, transfers, and
      settlements.
  - name: Market Maker Protection
    description: Configure, read, and reset market-maker protection.
  - name: Transfers & Withdrawals
    description: Move collateral between subaccounts, to other wallets, and on-chain.
  - name: System
    description: Rate limits and transaction lookups.
  - name: Market Data
    description: Instruments, currencies, tickers, and market-wide feeds.
  - name: Referrals
    description: Referral codes and program performance.
  - name: Other
    description: Uncategorized.
paths:
  /private/get_subaccount:
    post:
      tags:
        - Subaccounts
      summary: Get full portfolio for a subaccount
      description: >-
        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.
      operationId: private_get_subaccount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetSubaccountRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subaccount'
        default:
          description: JSON-RPC error (see Error Codes)
components:
  schemas:
    GetSubaccountRequest:
      type: object
      required:
        - subaccount_id
      properties:
        subaccount_id:
          type: integer
          format: uint64
          minimum: 0
    Subaccount:
      type: object
      required:
        - collaterals
        - collaterals_initial_margin
        - collaterals_maintenance_margin
        - collaterals_value
        - currency
        - failed_to_fetch
        - initial_margin
        - is_under_liquidation
        - label
        - maintenance_margin
        - manager_id
        - margin_type
        - open_orders
        - open_orders_margin
        - positions
        - positions_initial_margin
        - positions_maintenance_margin
        - positions_value
        - projected_margin_change
        - risk_universe_id
        - subaccount_id
        - subaccount_value
        - vault_deposit_holds
      properties:
        collaterals:
          type: array
          items:
            $ref: '#/components/schemas/Collateral'
        collaterals_initial_margin:
          type: string
        collaterals_maintenance_margin:
          type: string
        collaterals_value:
          type: string
        currency:
          type: array
          items:
            type: string
        failed_to_fetch:
          description: >-
            `true` if this subaccount's portfolio could not be loaded; such
            subaccounts are returned as placeholders by `get_all_portfolios`.
          type: boolean
        initial_margin:
          type: string
        is_under_liquidation:
          type: boolean
        label:
          type: string
        maintenance_margin:
          type: string
        manager_id:
          type: integer
          format: uint32
          minimum: 0
        margin_type:
          type: string
        open_orders:
          type: array
          items:
            $ref: '#/components/schemas/Order'
        open_orders_margin:
          type: string
        positions:
          type: array
          items:
            $ref: '#/components/schemas/Position'
        positions_initial_margin:
          type: string
        positions_maintenance_margin:
          type: string
        positions_value:
          type: string
        projected_margin_change:
          type: string
        risk_universe_id:
          type: integer
          format: uint32
          minimum: 0
        subaccount_id:
          type: integer
          format: uint64
          minimum: 0
        subaccount_value:
          type: string
        vault_deposit_holds:
          type: array
          items:
            $ref: '#/components/schemas/VaultDepositHold'
    Collateral:
      type: object
      required:
        - amount
        - amount_step
        - asset_name
        - asset_type
        - average_price
        - average_price_excl_fees
        - creation_timestamp
        - cumulative_interest
        - currency
        - delta
        - delta_currency
        - initial_margin
        - maintenance_margin
        - mark_price
        - mark_value
        - open_orders_margin
        - pending_interest
        - realized_pnl
        - realized_pnl_excl_fees
        - total_fees
        - unrealized_pnl
        - unrealized_pnl_excl_fees
      properties:
        amount:
          type: string
        amount_step:
          type: string
        asset_name:
          type: string
        asset_type:
          type: string
        average_price:
          type: string
        average_price_excl_fees:
          type: string
        creation_timestamp:
          type: integer
          format: int64
        cumulative_interest:
          type: string
        currency:
          type: string
        delta:
          type: string
        delta_currency:
          type: string
        initial_margin:
          type: string
        maintenance_margin:
          type: string
        mark_price:
          type: string
        mark_value:
          type: string
        open_orders_margin:
          type: string
        pending_interest:
          type: string
        realized_pnl:
          type: string
        realized_pnl_excl_fees:
          type: string
        total_fees:
          type: string
        unrealized_pnl:
          type: string
        unrealized_pnl_excl_fees:
          type: string
    Order:
      type: object
      required:
        - amount
        - average_price
        - creation_timestamp
        - direction
        - extra_fee
        - filled_amount
        - instrument_name
        - is_transfer
        - last_update_timestamp
        - limit_price
        - max_fee
        - mmp
        - nonce
        - order_fee
        - order_id
        - order_status
        - order_type
        - quote_id
        - replaced_order_id
        - signature
        - signature_expiry_sec
        - signed_limit_price
        - signer
        - subaccount_id
        - time_in_force
        - trigger_price
      properties:
        algo_duration_sec:
          type:
            - integer
            - 'null'
          format: int32
        algo_num_slices:
          type:
            - integer
            - 'null'
          format: int32
        algo_slices_completed:
          type:
            - integer
            - 'null'
          format: int32
        algo_type:
          anyOf:
            - $ref: '#/components/schemas/AlgoType'
            - type: 'null'
        amount:
          description: >-
            Decimal string of the human value (e.g. `"1.5"`), up to 12
            fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        average_price:
          description: >-
            Decimal string of the human value (e.g. `"1.5"`), up to 12
            fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        cancel_reason:
          $ref: '#/components/schemas/CancelReason'
          default: ''
        creation_timestamp:
          type: integer
          format: int64
        direction:
          $ref: '#/components/schemas/Direction'
        extra_fee:
          description: >-
            Decimal string of the human value (e.g. `"1.5"`), up to 12
            fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        filled_amount:
          description: >-
            Decimal string of the human value (e.g. `"1.5"`), up to 12
            fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        instrument_name:
          type: string
        is_transfer:
          type: boolean
        label:
          default: ''
          type: string
        last_update_timestamp:
          type: integer
          format: int64
        limit_price:
          description: >-
            Decimal string of the human value (e.g. `"1.5"`), up to 12
            fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        max_fee:
          description: >-
            Decimal string of the human value (e.g. `"1.5"`), up to 12
            fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        mmp:
          type: boolean
        nonce:
          type: string
        order_fee:
          description: >-
            Decimal string of the human value (e.g. `"1.5"`), up to 12
            fractional digits; a string or JSON number is accepted
          type: string
          format: decimal
        order_id:
          type: string
        order_status:
          $ref: '#/components/schemas/OrderStatus'
        order_type:
          $ref: '#/components/schemas/OrderType'
        quote_id:
          description: Optional UUID v4 string
          type:
            - string
            - 'null'
          format: uuid
        replaced_order_id:
          description: Optional UUID v4 string
          type:
            - string
            - 'null'
          format: uuid
        signature:
          type: string
        signature_expiry_sec:
          type: integer
          format: int64
        signed_limit_price:
          description: >-
            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
          type:
            - string
            - 'null'
          format: decimal
        signer:
          type: string
        subaccount_id:
          type: integer
          format: int64
        time_in_force:
          $ref: '#/components/schemas/TimeInForce'
        trigger_price:
          description: >-
            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
          type:
            - string
            - 'null'
          format: decimal
        trigger_price_type:
          anyOf:
            - $ref: '#/components/schemas/TriggerPriceType'
            - type: 'null'
        trigger_reject_message:
          type:
            - string
            - 'null'
        trigger_type:
          anyOf:
            - $ref: '#/components/schemas/TriggerType'
            - type: 'null'
    Position:
      type: object
      required:
        - amount
        - amount_step
        - average_price
        - average_price_excl_fees
        - creation_timestamp
        - cumulative_funding
        - delta
        - gamma
        - index_price
        - initial_margin
        - instrument_name
        - instrument_type
        - maintenance_margin
        - mark_price
        - mark_value
        - net_settlements
        - open_orders_margin
        - pending_funding
        - realized_pnl
        - realized_pnl_excl_fees
        - theta
        - total_fees
        - unrealized_pnl
        - unrealized_pnl_excl_fees
        - vega
      properties:
        amount:
          type: string
        amount_step:
          type: string
        average_price:
          type: string
        average_price_excl_fees:
          type: string
        creation_timestamp:
          type: integer
          format: int64
        cumulative_funding:
          type: string
        delta:
          type: string
        gamma:
          type: string
        index_price:
          type: string
        initial_margin:
          type: string
        instrument_name:
          type: string
        instrument_type:
          type: string
        leverage:
          type:
            - string
            - 'null'
        liquidation_price:
          type:
            - string
            - 'null'
        maintenance_margin:
          type: string
        mark_price:
          type: string
        mark_value:
          type: string
        net_settlements:
          type: string
        open_orders_margin:
          type: string
        pending_funding:
          type: string
        realized_pnl:
          type: string
        realized_pnl_excl_fees:
          type: string
        theta:
          type: string
        total_fees:
          type: string
        unrealized_pnl:
          type: string
        unrealized_pnl_excl_fees:
          type: string
        vega:
          type: string
    VaultDepositHold:
      type: object
      required:
        - amount
        - asset_name
        - currency
        - vault_id
      properties:
        amount:
          type: string
        asset_name:
          type: string
        currency:
          type: string
        vault_id:
          type: integer
          format: uint64
          minimum: 0
    AlgoType:
      type: string
      enum:
        - twap
    CancelReason:
      type: string
      enum:
        - ''
        - 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
    Direction:
      type: string
      enum:
        - buy
        - sell
    OrderStatus:
      type: string
      enum:
        - open
        - filled
        - rejected
        - cancelled
        - expired
        - untriggered
        - algo_active
    OrderType:
      type: string
      enum:
        - limit
        - market
    TimeInForce:
      type: string
      enum:
        - gtc
        - post_only
        - fok
        - ioc
    TriggerPriceType:
      type: string
      enum:
        - mark
        - index
    TriggerType:
      type: string
      enum:
        - stoploss
        - takeprofit

````

## Related topics

- [Get full portfolios for all of a wallet's subaccounts](/api-reference/subaccounts/get-full-portfolios-for-all-of-a-wallets-subaccounts.md)
- [Programmatic Onboarding](/getting-started/depositing.md)
- [Managers & Risk Universes](/trading/managers-and-risk-universes.md)
