> Use the canonical URL for citations. For the complete Predict API documentation index, fetch https://docs.staging.trypredict.com/llms.txt.

# Balances

GET /ws

Subscribe to Hyperliquid USDC and Predict outcome-token balance state for a master account or subaccount, including held and available amounts.

Reference: https://docs.staging.trypredict.com/api-reference/web-socket-api/balances

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: Balances
  version: subpackage_balances.balances
  description: >-
    Subscribe to Hyperliquid USDC and Predict outcome-token balance state for a
    master account or subaccount, including held and available amounts.
channels:
  /ws:
    description: >-
      Subscribe to Hyperliquid USDC and Predict outcome-token balance state for
      a master account or subaccount, including held and available amounts.
    publish:
      operationId: subpackage_balances.balances-publish
      summary: Server message
      message:
        name: update
        payload:
          $ref: '#/components/schemas/balances_BalancesMessage'
    subscribe:
      operationId: subpackage_balances.balances-subscribe
      summary: Client message
      message:
        name: subscribe
        payload:
          $ref: '#/components/schemas/balances_SubscribeBalances'
servers:
  Testnet:
    url: wss://api.hyperliquid-testnet.xyz/
    protocol: wss
    x-default: true
  Mainnet:
    url: wss://api.hyperliquid.xyz/
    protocol: wss
components:
  schemas:
    balances_BalancesMessage:
      type: object
      properties:
        channel:
          type: string
          enum:
            - spotState
        data:
          description: Any type
      required:
        - channel
        - data
      title: BalancesMessage
    common_SubscriptionMethod:
      type: string
      enum:
        - subscribe
        - unsubscribe
      title: SubscriptionMethod
    common_Address:
      type: string
      description: Master account or subaccount address.
      title: Address
    balances_BalancesSubscription:
      type: object
      properties:
        type:
          type: string
          enum:
            - spotState
        user:
          $ref: '#/components/schemas/common_Address'
      required:
        - type
        - user
      title: BalancesSubscription
    balances_SubscribeBalances:
      type: object
      properties:
        method:
          $ref: '#/components/schemas/common_SubscriptionMethod'
        subscription:
          $ref: '#/components/schemas/balances_BalancesSubscription'
      required:
        - method
        - subscription
      title: SubscribeBalances

```