> ## Documentation Index
> Fetch the complete documentation index at: https://pmxt-sync-hosted-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Balance

> Check the USDC available for trading. Returns the wallet's balance inside the PMXT escrow on Polygon — *not* the wallet's on-chain USDC balance.

Top up by depositing at [pmxt.dev/dashboard/wallet](https://pmxt.dev/dashboard/wallet).

<Info>
  **Available on:** Polymarket, Opinion, Limitless. Other venues raise `NotSupported` in hosted mode — for those, run a [local PMXT service](/guides/self-hosted).
</Info>

<Tip>
  Use any EVM private key. Your USDC sits in a non-custodial PreFundedEscrow on Polygon — for Polymarket, Opinion, and Limitless. PMXT cannot move funds without your EIP-712 signature.
</Tip>


## OpenAPI

````yaml /api-reference/openapi-hosted-trading.json get /v0/user/{address}/balances
openapi: 3.0.0
info:
  title: PMXT Hosted Router API
  description: Hosted-only endpoints for cross-venue search, matching, arbitrage, and SQL.
  version: 49fbcd4
servers:
  - url: https://trade.pmxt.dev
    description: Hosted trading (v0)
security:
  - bearerAuth: []
tags:
  - name: Trading (Hosted)
    description: >-
      Hosted trading endpoints. Build / submit / cancel orders via
      `trade.pmxt.dev/v0/*`. Hosted-mode is the default when `pmxt_api_key` is
      set.
  - name: Orders & Positions (Hosted)
    description: >-
      Hosted account reads. Open orders, fills, balances, and positions via
      `trade.pmxt.dev/v0/*`. Requires `pmxt_api_key` + `wallet_address`.
  - name: MatchedMarkets
    description: Cross-venue matched market and event clusters.
  - name: SQL
    description: Direct read-only SQL access to the catalog (Enterprise).
paths:
  /v0/user/{address}/balances:
    get:
      tags:
        - Orders & Positions
      summary: Fetch Balance
      description: >-
        Check the USDC available for trading. Returns the wallet's balance
        inside the PMXT escrow on Polygon — *not* the wallet's on-chain USDC
        balance.


        Top up by depositing at
        [pmxt.dev/dashboard/wallet](https://pmxt.dev/dashboard/wallet).
      operationId: fetchBalanceHosted
      parameters:
        - in: path
          name: address
          required: true
          schema:
            type: string
          description: EVM wallet address (lowercase or checksum).
      responses:
        '200':
          description: Balance for the wallet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceV0'
        '401':
          description: Invalid or missing PMXT API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostedErrorResponse'
        '503':
          description: Catalog or escrow indexer temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HostedErrorResponse'
      x-codeSamples:
        - lang: python
          label: Polymarket
          source: >
            # Hosted reads need: pmxt_api_key + wallet_address (private_key is
            only required for writes).

            import pmxt


            client = pmxt.Polymarket(
                pmxt_api_key="YOUR_PMXT_API_KEY",
                wallet_address="0xYourWallet",
            )

            balances = client.fetch_balance()

            balance = balances[0]

            print(balance.available, balance.currency)
        - lang: javascript
          label: Polymarket
          source: >
            // Hosted reads need: pmxtApiKey + walletAddress (privateKey is only
            required for writes).

            import { Polymarket } from "pmxtjs";


            const client = new Polymarket({
              pmxtApiKey: "YOUR_PMXT_API_KEY",
              walletAddress: "0xYourWallet",
            });


            const balances = await client.fetchBalance();

            console.log(balances[0].available, balances[0].currency);
        - lang: python
          label: Opinion
          source: >
            # Hosted reads need: pmxt_api_key + wallet_address (private_key is
            only required for writes).

            import pmxt


            client = pmxt.Opinion(
                pmxt_api_key="YOUR_PMXT_API_KEY",
                wallet_address="0xYourWallet",
            )

            balances = client.fetch_balance()

            balance = balances[0]

            print(balance.available, balance.currency)
        - lang: javascript
          label: Opinion
          source: >
            // Hosted reads need: pmxtApiKey + walletAddress (privateKey is only
            required for writes).

            import { Opinion } from "pmxtjs";


            const client = new Opinion({
              pmxtApiKey: "YOUR_PMXT_API_KEY",
              walletAddress: "0xYourWallet",
            });


            const balances = await client.fetchBalance();

            console.log(balances[0].available, balances[0].currency);
components:
  schemas:
    BalanceV0:
      type: object
      description: >-
        Hosted-mode `Balance` shape. Returns USDC held inside the PMXT
        `PreFundedEscrow` contract.
      required:
        - currency
        - amount
      properties:
        currency:
          type: string
          default: USDC
          description: >-
            Currency code. Always `USDC` -- the only collateral accepted by the
            hosted escrow.
        amount:
          type: number
          description: >-
            Spendable USDC dollars held inside the PMXT PreFundedEscrow on
            Polygon (NOT the venue-native CLOB-proxy balance). Backs trading on
            Polymarket, Opinion, and Limitless.
        venue:
          type: string
          enum:
            - polymarket
            - opinion
            - limitless
          nullable: true
          description: >-
            Set when the hosted backend returns a per-venue breakdown; null when
            balance is venue-agnostic.
    HostedErrorResponse:
      type: object
      description: >-
        Error envelope returned by `trade.pmxt.dev/v0/*` endpoints. Mirrors the
        `ErrorDetail` shape used inside `BaseResponse.error` from the sidecar
        spec.
      required:
        - error
      properties:
        error:
          type: object
          description: Structured error envelope. Always present on non-2xx responses.
          properties:
            message:
              type: string
              description: Human-readable explanation safe to surface to end users.
            code:
              type: string
              description: >-
                Stable hosted-mode error code. Use this (not `message`) for
                branching in client code.
              enum:
                - HOSTED_TRADING_ERROR
                - INSUFFICIENT_ESCROW_BALANCE
                - ORDER_SIZE_TOO_SMALL
                - INVALID_API_KEY
                - OUTCOME_NOT_FOUND
                - CATALOG_UNAVAILABLE
                - BUILT_ORDER_EXPIRED
                - INVALID_SIGNATURE
                - NO_LIQUIDITY
                - MISSING_WALLET_ADDRESS
                - ORDER_NOT_FOUND
                - INVALID_ORDER
            retryable:
              type: boolean
              description: >-
                `true` when the same request may succeed if retried (e.g.
                transient catalog outage); `false` when the caller must change
                inputs first.
            exchange:
              type: string
              nullable: true
              description: >-
                Source venue that produced the error (e.g. `polymarket`,
                `opinion`, `limitless`), when the failure originated upstream of
                PMXT. `null` for PMXT-side errors.
            detail:
              type: object
              additionalProperties: {}
              nullable: true
              description: >-
                Free-form structured diagnostics (e.g. required minimum size,
                escrow balance available). Shape varies per `code`.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Required when calling the hosted API directly (curl, requests, fetch).
        SDK users pass credentials via constructor params instead.

````