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

# Get Account Balance

> Query account balances. Returns all subaccounts' vault balances.



## OpenAPI

````yaml /v2/api-reference/openapi.json get /api/v1/account/balance
openapi: 3.1.0
info:
  title: ekiden-gateway
  description: >-
    API Gateway and WebSocket proxy based on Axum and Utoipa, handling auth,
    rate limiting, and connection buffering.
  license:
    name: ''
  version: 0.1.1
servers:
  - url: https://api.dev.ekiden.fi/
    description: Production (Canton Mainnet)
security: []
paths:
  /api/v1/account/balance:
    get:
      tags:
        - Account
      summary: Get Account Balance
      description: Query account balances. Returns all subaccounts' vault balances.
      operationId: get_account_balance
      responses:
        '200':
          description: Balances
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAccountBalanceResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    GetAccountBalanceResponse:
      type: object
      description: Account balance response structure.
      required:
        - list
      properties:
        list:
          type: array
          items:
            $ref: '#/components/schemas/AccountBalance'
    AccountBalance:
      type: object
      description: Account-wide wallet and margin metrics.
      required:
        - sub_account_address
        - account_type
        - equity
        - vault_balance
        - margin_balance
        - available_balance
        - accrued_interest
        - total_order_im
        - total_position_im
        - total_position_mm
        - unrealised_pnl
        - unrealized_funding
        - realised_pnl_cum
      properties:
        account_type:
          type: string
          description: Account type (e.g. Funding, Trading)
        accrued_interest:
          type: string
          description: Accrued interest
        available_balance:
          type: string
          description: >-
            The amount of an asset that can be used to open USDC Perpetual
            positions (USDC)
        collateral:
          type: array
          items:
            $ref: '#/components/schemas/CollateralBalance'
          description: Non-quote collateral. Omitted when empty.
        debt:
          type:
            - string
            - 'null'
          description: >-
            Quote owed: how far the quote balance is below zero (`vault_balance`
            then shows zero). The

            collateral's values above are already after haircuts. Omitted when
            nothing is owed.
        equity:
          type: string
          description: >-
            What the account is worth to liquidation, in USDC, floored at zero:
            the quote balance (a

            debt counted in full) plus unrealized P&L and funding plus unfrozen
            collateral at its

            maintenance weight. That is `maintenance_total_collateral` floored
            at zero when it is

            shown, and Vault Balance + Unrealized P&L + Unrealized Funding with
            only the quote. Funding

            accounts: the quote balance.
        fee_asset:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            The first asset other than the quote in `fee_priority`. Trading
            accounts only; omitted

            while there is none.
          minimum: 0
        fee_priority:
          type: array
          items:
            type: integer
            format: int32
            minimum: 0
          description: >-
            The assets fees are taken from first, in order (`PUT
            /account/fee-priority`); then the

            quote and the other stablecoins by liquidation priority, then quote
            debt. A volatile asset

            pays fees only when listed here. Trading accounts only; omitted
            while empty.
        initial_total_collateral:
          type:
            - string
            - 'null'
          description: >-
            Quote balance (a debt counted in full), unrealized PnL, funding, and
            weighted non-quote,

            in USDC. Trading accounts holding non-quote collateral or owing a
            debt only.
        maintenance_total_collateral:
          type:
            - string
            - 'null'
          description: >-
            Same total at maintenance weight, frozen collateral excluded.
            Present when

            `initial_total_collateral` is.
        margin_balance:
          type: string
          description: Same as `equity`.
        realised_pnl_cum:
          type: string
          description: Cumulative Realised P&L
        sub_account_address:
          type: string
          description: Sub-Account address (the owner of the technical vault)
        total_order_im:
          type: string
          description: Pre-occupied margin for order. Locked balance (USDC)
        total_position_im:
          type: string
          description: Sum of initial margin of all positions.
        total_position_mm:
          type: string
          description: >-
            Sum of maintenance margin for all positions, including estimated
            close fees.
        unrealised_pnl:
          type: string
          description: Unrealised P&L
        unrealized_funding:
          type: string
          description: Aggregated unrealized funding across all positions (USDC)
        vault_balance:
          type: string
          description: Vault Balance (USDC)
    CollateralBalance:
      type: object
      required:
        - asset_id
        - symbol
        - balance
        - frozen
      properties:
        asset_id:
          type: integer
          format: int32
          minimum: 0
        balance:
          type: string
          description: Whole tokens, including the hold.
        frozen:
          type: string
          description: Whole tokens on hold.
        initial_value:
          type:
            - string
            - 'null'
          description: USDC. Trading accounts only.
        initial_weight:
          type:
            - string
            - 'null'
          description: >-
            Effective initial weight, e.g. `"0.98"`; `"0"` unless active and
            freshly priced.

            Trading accounts only.
        maintenance_value:
          type:
            - string
            - 'null'
          description: USDC. Trading accounts only.
        maintenance_weight:
          type:
            - string
            - 'null'
          description: Effective maintenance weight, e.g. `"0.99"`. Trading accounts only.
        price:
          type:
            - string
            - 'null'
          description: >-
            USDC per token, net of the oracle confidence haircut. Trading
            accounts only.
        symbol:
          type: string
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````

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