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

# Balances, fee tier and agents



## OpenAPI

````yaml /developer/trading-api/openapi.json get /v1/{chain}/account/{address}
openapi: 3.1.0
info:
  title: Gains Trading API
  version: 1.0.0
  description: >-
    Native REST and WebSocket API for trading on Gains Network.
    Resource-oriented, JSON in and out, decimal strings for every price and
    size, one EIP-712 signing scheme, and an order lifecycle that hides the
    oracle two-step.
servers:
  - url: https://api.gains.trade
security: []
tags:
  - name: Markets
    description: Public market data
  - name: Account
    description: 'Private reads: balances, positions, orders, fills'
  - name: Orders
    description: Place, update and cancel orders
  - name: Positions
    description: Close and manage open positions
  - name: Agents
    description: Non-custodial agent authorisation
  - name: System
    description: Health
paths:
  /v1/{chain}/account/{address}:
    get:
      tags:
        - Account
      summary: Balances, fee tier and agents
      operationId: getAccount
      parameters:
        - schema:
            type: string
            enum:
              - arbitrum
              - base
              - polygon
              - megaeth
              - arbitrum-sepolia
            example: arbitrum
          required: true
          name: chain
          in: path
        - schema:
            type: string
            example: '0x73b3A111C5BCCf9086c97B96e0AbAad69Dc4f523'
          required: true
          name: address
          in: path
      responses:
        '200':
          description: The account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Credentials valid but not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Service not ready
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - AgentSignature: []
        - ApiKey: []
components:
  schemas:
    Account:
      type: object
      properties:
        address:
          type: string
          pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x73b3A111C5BCCf9086c97B96e0AbAad69Dc4f523'
        balances:
          type: array
          items:
            type: object
            properties:
              collateral:
                type: string
              balance:
                type: string
                pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
                example: '0.5'
                description: Decimal number encoded as a string to preserve precision.
              allowance:
                type: string
                pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
                example: '0.5'
                description: Decimal number encoded as a string to preserve precision.
            required:
              - collateral
              - balance
              - allowance
        feeTierMultiplier:
          type:
            - string
            - 'null'
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          example: '0.5'
          description: Decimal number encoded as a string to preserve precision.
        referrer:
          type:
            - string
            - 'null'
          pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x73b3A111C5BCCf9086c97B96e0AbAad69Dc4f523'
        agents:
          type: array
          items:
            $ref: '#/components/schemas/Agent'
      required:
        - address
        - balances
        - feeTierMultiplier
        - referrer
        - agents
    Error:
      type: object
      properties:
        code:
          type: string
          enum:
            - VALIDATION_ERROR
            - UNAUTHENTICATED
            - INVALID_SIGNATURE
            - TIMESTAMP_OUT_OF_WINDOW
            - NONCE_REUSED
            - AGENT_UNKNOWN
            - API_KEY_UNKNOWN
            - AGENT_NOT_DELEGATED
            - AGENT_EXPIRED
            - AGENT_REVOKED
            - SCOPE_READ_ONLY
            - SCOPE_MARKET_NOT_ALLOWED
            - SCOPE_LEVERAGE_EXCEEDED
            - SCOPE_SPEND_CAP_EXCEEDED
            - TRADER_MISMATCH
            - CHAIN_NOT_FOUND
            - CHAIN_READ_ONLY
            - MARKET_NOT_FOUND
            - ORDER_NOT_FOUND
            - POSITION_NOT_FOUND
            - AGENT_NOT_FOUND
            - IDEMPOTENCY_CONFLICT
            - ORDER_NOT_MODIFIABLE
            - PRECISION_ERROR
            - LEVERAGE_OUT_OF_RANGE
            - SIZE_BELOW_MINIMUM
            - MARKET_CLOSED
            - COLLATERAL_NOT_SUPPORTED
            - SIMULATION_REVERTED
            - SUBMISSION_MISMATCH
            - UNSUPPORTED
            - RATE_LIMITED
            - INTERNAL
            - UPSTREAM_UNAVAILABLE
            - NOT_READY
        message:
          type: string
        details:
          type: object
          additionalProperties: {}
      required:
        - code
        - message
    Agent:
      type: object
      properties:
        agent:
          type: string
          pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x73b3A111C5BCCf9086c97B96e0AbAad69Dc4f523'
        trader:
          type: string
          pattern: ^0x[0-9a-fA-F]{40}$
          example: '0x73b3A111C5BCCf9086c97B96e0AbAad69Dc4f523'
        name:
          type:
            - string
            - 'null'
        scope:
          $ref: '#/components/schemas/AgentScope'
        mode:
          type: string
          enum:
            - self
            - relayed
          description: >-
            self: the agent signs and broadcasts as the trader's delegate.
            relayed: the Hyperliquid facade relayer is the delegate.
        status:
          type: string
          enum:
            - pending_delegation
            - active
            - revoked
            - expired
        createdAt:
          type: integer
      required:
        - agent
        - trader
        - name
        - scope
        - mode
        - status
        - createdAt
    AgentScope:
      type: object
      properties:
        markets:
          anyOf:
            - type: string
              enum:
                - all
            - type: array
              items:
                type: string
                pattern: ^[A-Z0-9.]{1,15}\/[A-Z0-9]{1,10}$
                example: BTC/USD
                description: Gains market symbol, `<base>/<quote>`.
        maxLeverage:
          type:
            - string
            - 'null'
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          example: '0.5'
          description: Decimal number encoded as a string to preserve precision.
        dailySpendCapUsd:
          type:
            - string
            - 'null'
          pattern: ^-?(?:0|[1-9]\d*)(?:\.\d+)?$
          example: '0.5'
          description: Decimal number encoded as a string to preserve precision.
        expiresAt:
          type:
            - integer
            - 'null'
          description: Epoch milliseconds, or null for no expiry.
        permissions:
          type: string
          enum:
            - trade
            - read
      required:
        - markets
        - maxLeverage
        - dailySpendCapUsd
        - expiresAt
        - permissions
  securitySchemes:
    AgentSignature:
      type: apiKey
      in: header
      name: X-Gains-Signature
      description: >-
        EIP-712 signature by an authorised agent over {method, path, body,
        timestamp, nonce}, sent with X-Gains-Agent, X-Gains-Timestamp and
        X-Gains-Nonce.
    ApiKey:
      type: apiKey
      in: header
      name: X-Gains-Api-Key
      description: Read-only key issued by POST /v1/{chain}/api-keys.

````