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

# Get user collateral totals

> Handles `GET /v1/users/{user_pubkey}/collateral-totals` via `get.v1.users.by_user_pubkey.collateral_totals`.



## OpenAPI

````yaml /openapi/phoenix-public-api.json get /v1/users/{user_pubkey}/collateral-totals
openapi: 3.1.0
info:
  title: Phoenix Eternal API
  description: >-
    RESTful API for accessing Phoenix Eternal perpetual trading data. Provides
    real-time orderbook levels, asset information, and market metadata.
  termsOfService: https://www.phoenix.trade/terms-of-service
  contact:
    name: Phoenix Development Team
    url: https://github.com/Ellipsis-Labs/phoenix
  license:
    name: Proprietary
  version: 1.0.0
servers:
  - url: https://perp-api.phoenix.trade
    description: Phoenix Eternal Perp API
security: []
tags:
  - name: Auth
    description: Wallet and session authentication.
  - name: Exchange
    description: Exchange, market, candle, and no-referral register-instruction workflows.
  - name: Invite
    description: Invite validation, referral activation, and wallet allowlist checks.
  - name: Notifications
    description: Trader notification reads and acknowledgement helpers.
  - name: Trader
    description: Trader state, account history, and transaction builders.
externalDocs:
  url: https://docs.phoenix.trade
  description: Phoenix developer documentation
paths:
  /v1/users/{user_pubkey}/collateral-totals:
    get:
      tags:
        - Trader
      summary: Get user collateral totals
      description: >-
        Handles `GET /v1/users/{user_pubkey}/collateral-totals` via
        `get.v1.users.by_user_pubkey.collateral_totals`.
      operationId: get.v1.users.by_user_pubkey.collateral_totals
      parameters:
        - name: user_pubkey
          in: path
          description: User pubkey (base58 encoded)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Collateral totals
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollateralTotalsResponse'
components:
  schemas:
    CollateralTotalsResponse:
      type: object
      description: >-
        Lifetime deposit and withdrawal totals for a user across all subaccounts

        and collateral assets. Spot events are valued at the index price of
        their

        pricing market at event time; quote events are 1:1. Transfers, swaps and

        liquidations are excluded, matching the rows classified as `deposit` /

        `withdrawal` in the mixed collateral history.
      required:
        - totalDeposited
        - totalWithdrawn
        - assets
      properties:
        assets:
          type: array
          items:
            $ref: '#/components/schemas/CollateralAssetTotals'
          description: |-
            Per-asset breakdown; only assets with at least one deposit or
            withdrawal appear.
        totalDeposited:
          type: number
          format: double
          description: Sum of `assets[].deposited.value`.
        totalWithdrawn:
          type: number
          format: double
          description: Sum of `assets[].withdrawn.value`.
    CollateralAssetTotals:
      type: object
      description: Deposit and withdrawal totals for one collateral asset.
      required:
        - assetIndex
        - symbol
        - decimals
        - deposited
        - withdrawn
      properties:
        assetIndex:
          type: integer
          format: int64
          description: On-chain `AssetIndex` of the collateral asset.
        decimals:
          type: integer
          format: int32
          description: Native decimals of the asset.
        deposited:
          $ref: '#/components/schemas/CollateralFlowTotal'
        symbol:
          type: string
          description: Asset symbol from the asset registry.
        unpricedEvents:
          type: integer
          format: int64
          description: |-
            Number of deposit or withdrawal events for this asset that had no
            event-time price and are excluded from `deposited.value` /
            `withdrawn.value`.
          minimum: 0
        withdrawn:
          $ref: '#/components/schemas/CollateralFlowTotal'
    CollateralFlowTotal:
      type: object
      description: One direction (deposits or withdrawals) of a single collateral asset.
      required:
        - amount
        - value
      properties:
        amount:
          type: integer
          format: int64
          description: |-
            Native units of the asset moved in this direction, as a positive
            magnitude (same scale as `CollateralEventV2::amount`).
        value:
          type: number
          format: double
          description: >-
            Quote-unit (USD) value: each event valued at its own event-time
            price.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.