> ## 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 active positions for a subaccount

> Returns the subaccount ID and the list of its active positions, including size, mark price, average price, unrealized and realized PnL, and Greeks where applicable, valued against live feed data at request time. A lighter alternative to get_subaccount when only positions are needed.



## OpenAPI

````yaml /openapi.json post /private/get_positions
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_positions:
    post:
      tags:
        - Subaccounts
      summary: Get active positions for a subaccount
      description: >-
        Returns the subaccount ID and the list of its active positions,
        including size, mark price, average price, unrealized and realized PnL,
        and Greeks where applicable, valued against live feed data at request
        time. A lighter alternative to get_subaccount when only positions are
        needed.
      operationId: private_get_positions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetPositionsRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrivateGetPositionsResponse'
        default:
          description: JSON-RPC error (see Error Codes)
components:
  schemas:
    GetPositionsRequest:
      type: object
      required:
        - subaccount_id
      properties:
        subaccount_id:
          type: integer
          format: uint64
          minimum: 0
    PrivateGetPositionsResponse:
      type: object
      required:
        - positions
        - subaccount_id
      properties:
        positions:
          type: array
          items:
            $ref: '#/components/schemas/Position'
        subaccount_id:
          type: integer
          format: uint64
          minimum: 0
    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

````

## Related topics

- [Get full portfolio for a subaccount](/api-reference/subaccounts/get-full-portfolio-for-a-subaccount.md)
- [Get full portfolios for all of a wallet's subaccounts](/api-reference/subaccounts/get-full-portfolios-for-all-of-a-wallets-subaccounts.md)
- [Get option settlement history for a subaccount](/api-reference/history/get-option-settlement-history-for-a-subaccount.md)
