> ## 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 /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.ekiden.fi/
    description: Production
  - url: https://api.staging.ekiden.fi/
    description: Staging
  - url: https://api.dev.ekiden.fi/
    description: Development
  - url: http://localhost:4020/
    description: Local
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)
        equity:
          type: string
          description: >-
            Equity under the account without considering the collateral value
            ratio (calculated in USDC).

            Equity = Vault Balance + Perp & Futures Unrealized P&L + Unrealized
            Funding
        margin_balance:
          type: string
          description: |-
            Amount that can be used as margin under the account
            after considering the collateral value ratio (calculated in USDC)
            Total Vault Balance + Perp Unrealized P&L
        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)
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````