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

# Get runtime ledger balances

> Returns derived non-zero ledger balances. The optional account_type query
filters the returned balances, while healthy and entry_count still describe the whole ledger.




## OpenAPI

````yaml /openapi.yaml get /v1/runtime/ledger
openapi: 3.1.0
info:
  title: Firmament Backend API
  version: 0.1.3
  summary: Public backend routes for Firmament swaps and runtime proof.
  description: >
    Firmament is a Solana RFQ maker backend for managed liquidity demos.

    This specification documents the public routes used by the swap app and
    runtime view.
servers:
  - url: https://api.firmament.shaikazeem.com
    description: Deployed Firmament API.
  - url: http://127.0.0.1:5050
    description: Local backend started with `cargo run`.
security: []
tags:
  - name: Health
    description: Runtime liveness.
  - name: Assets
    description: Supported Solana assets.
  - name: Pairs
    description: Configured directional pairs and constraints.
  - name: RFQ
    description: Firm quote requests.
  - name: Settlement
    description: Browser-wallet HTLC settlement.
  - name: Trades
    description: Trade status lookup.
  - name: Runtime
    description: Read-only runtime state, events, ledger, and trades.
paths:
  /v1/runtime/ledger:
    get:
      tags:
        - Runtime
      summary: Get runtime ledger balances
      description: >
        Returns derived non-zero ledger balances. The optional account_type
        query

        filters the returned balances, while healthy and entry_count still
        describe the whole ledger.
      operationId: getRuntimeLedger
      parameters:
        - name: account_type
          in: query
          required: false
          description: Optional ledger account type filter.
          schema:
            $ref: '#/components/schemas/LedgerAccountType'
      responses:
        '200':
          description: Ledger snapshot.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LedgerSnapshotResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    LedgerAccountType:
      type: string
      enum:
        - working_custody
        - reserved
        - pending_dex_spend
        - receivable
        - htlc_escrow
        - pending_escrow
        - gateway
        - gateway_reserved
        - pending_gateway_deposit
        - rebalance
        - fees
        - trading
        - external
    LedgerSnapshotResponse:
      type: object
      required:
        - healthy
        - entry_count
        - balances
      properties:
        healthy:
          type: boolean
          description: >-
            True when ledger integrity passes and protected accounts are not
            negative.
        entry_count:
          type: integer
          minimum: 0
          description: Total ledger entry count across the whole ledger.
        balances:
          type: array
          items:
            $ref: '#/components/schemas/LedgerBalanceEntry'
    LedgerBalanceEntry:
      type: object
      required:
        - account_type
        - asset
        - balance_raw
        - decimals
        - display_amount
      properties:
        account_type:
          $ref: '#/components/schemas/LedgerAccountType'
        asset:
          type: string
          example: USDC
        qualifier:
          type:
            - string
            - 'null'
          description: >-
            Optional ledger qualifier. Public responses never include wallet
            addresses.
        balance_raw:
          type: string
          description: Signed raw token amount serialized as a string.
          example: '1000000'
        decimals:
          type: integer
          minimum: 0
          maximum: 18
          example: 6
        display_amount:
          type: string
          example: '1.000000'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              example: invalid_json
            message:
              type: string
            details:
              type: array
              items:
                type: string
  responses:
    BadRequest:
      description: Request shape, path, or validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: Runtime service is not available for the requested action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````