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

# List all tradable pairs

> The market catalog: for each pair, its index (used in every trading request), leverage bounds (regular and market_pnl), minimum position size, open-interest headroom, trading schedule, and listing / close-only status. Cached for a few minutes.



## OpenAPI

````yaml https://tx-builder-testnet.avantisfi.com/openapi.json get /v2/pairs
openapi: 3.0.3
info:
  title: Avantis v2 API
  version: 2.0.0
  description: >-
    Calldata builders, EIP-712 intent builders, signed-tx relay, and on-chain
    reads for the Avantis v2 perp protocol.


    **Conventions**

    - Every build/read endpoint accepts both GET (query string) and POST (JSON
    body) with the same fields; POST /v2/relay is POST-only.

    - All amounts are human units: `collateralUsdc: 100` = 100 USDC, `leverage:
    10` = 10x, prices are plain USD decimals. The API does all on-chain scaling.

    - Responses use the `{ ok: true, data }` / `{ ok: false, error: { code,
    message, details } }` envelope.

    - Calldata responses (`to`, `from`, `data`, `value`) are unsigned — the
    caller signs and broadcasts (or submits via POST /v2/relay). `from` is who
    must sign; `value` is hex wei.

    - Intent responses (`domain`, `types`, `primaryType`, `message`) feed
    directly into EIP-712 signTypedData; the Avantis operator executes them
    gas-free for the signer.

    - Trading endpoints are rate-limited per IP.


    Start with GET /v2/meta (addresses, enums, units, defaults) and GET
    /v2/pairs (market catalog).
servers:
  - url: https://tx-builder-testnet.avantisfi.com
security: []
tags:
  - name: meta
    description: Service metadata, pair catalog, health and metrics.
  - name: trading
    description: >-
      Build unsigned transactions for market/limit opens and closes, margin
      changes, and position increases (the direct, self-broadcast route).
  - name: delegate
    description: >-
      Authorize or revoke a delegate key that can trade on behalf of a trader
      (never move funds).
  - name: token
    description: >-
      USDC approval transactions — the one-time prerequisite before trading or
      LP deposits.
  - name: intents
    description: >-
      Build EIP-712 typed-data payloads to sign; the Avantis operator submits
      them on-chain so the signer pays no gas (the relayer route).
  - name: relay
    description: >-
      Submit an already-signed transaction through Avantis-operated RPCs:
      whitelist check, simulation with decoded revert reasons, then broadcast.
  - name: twap
    description: >-
      Time-weighted orders, filled in slices by the operator over a chosen
      duration.
  - name: referral
    description: >-
      Referral code registration, assignment, ownership transfer, and rebate
      claims.
  - name: lp
    description: >-
      Liquidity-provider flows on the Avantis USDC vault (ERC-4626 avUSDC
      tranche).
  - name: misc
    description: Keeper reward claims, vault buffer top-ups, and builder-code registration.
  - name: reads
    description: >-
      On-chain lookups the SDK needs for signing correctness: nonces, positions,
      delegation state, allowances.
paths:
  /v2/pairs:
    get:
      tags:
        - meta
      summary: List all tradable pairs
      description: >-
        The market catalog: for each pair, its index (used in every trading
        request), leverage bounds (regular and market_pnl), minimum position
        size, open-interest headroom, trading schedule, and listing / close-only
        status. Cached for a few minutes.
      operationId: getV2Pairs
      parameters:
        - name: raw
          in: query
          required: false
          description: Include the unprocessed upstream data-API record for each pair.
          schema:
            anyOf:
              - type: boolean
              - type: string
            default: false
            description: Include the unprocessed upstream data-API record for each pair.
      responses:
        '200':
          description: >-
            Success envelope: `ok` is `true` and `data` carries the payload
            documented below.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    description: Always `true` on success.
                  data:
                    type: array
                    description: The market catalog, sorted by pair index.
                    items:
                      type: object
                      description: A tradable pair from the catalog.
                      properties:
                        index:
                          type: integer
                          description: >-
                            Pair index — the identifier used in every trading
                            request.
                        from:
                          type: string
                          description: Base asset symbol, e.g. `ETH`.
                        to:
                          type: string
                          description: Quote asset symbol, e.g. `USD`.
                        symbol:
                          type: string
                          description: Full pair symbol, e.g. `ETH/USD`.
                        groupIndex:
                          type: integer
                          description: >-
                            Asset group this pair belongs to (drives group-level
                            OI checks).
                        isPairListed:
                          type: boolean
                          description: >-
                            `false` means the pair is delisted and new trades
                            are rejected.
                        closeOnly:
                          type: boolean
                          description: >-
                            `true` blocks opens and position increases
                            (close-only mode).
                        leverages:
                          type: object
                          description: Leverage envelopes as plain multipliers (75 = 75x).
                          properties:
                            minLeverage:
                              type: number
                              description: Minimum leverage on the fixed-fee path.
                            maxLeverage:
                              type: number
                              description: Maximum leverage on the fixed-fee path.
                            pnlMinLeverage:
                              type: number
                              description: >-
                                Minimum leverage on the PnL-fee (`market_pnl`)
                                path.
                            pnlMaxLeverage:
                              type: number
                              description: >-
                                Maximum leverage on the PnL-fee (`market_pnl`)
                                path.
                        pairMinLevPosUSDC:
                          type: number
                          description: >-
                            Minimum `collateral × leverage` allowed, USDC (human
                            units).
                        pairOI:
                          type: number
                          description: Current open interest on the pair, USDC.
                        pairMaxOI:
                          type: number
                          description: Maximum allowed open interest on the pair, USDC.
                        maxWalletOI:
                          type: number
                          description: Per-wallet open-interest cap for this pair, USDC.
                        lazerFeed:
                          type: object
                          description: >-
                            Pyth Lazer feed configuration, when the pair has
                            one.
                          properties:
                            feedId:
                              type: integer
                              description: Lazer feed id.
                            state:
                              type: string
                              description: '`stable` or `unstable`.'
                          nullable: true
                        feed:
                          type: object
                          description: >-
                            Upstream price-feed record (feed id, deviation
                            bounds, market-hours attributes).
                          properties: {}
                          additionalProperties: true
                          nullable: true
                        schedule:
                          type: object
                          description: >-
                            Trading schedule from the price feed. Crypto pairs
                            typically have no schedule (`nextOpen=0,
                            nextClose=0`).
                          properties:
                            isOpen:
                              type: boolean
                              description: Whether the market is currently open.
                            nextOpen:
                              type: number
                              description: Unix seconds of the next open; 0 = no schedule.
                            nextClose:
                              type: number
                              description: Unix seconds of the next close; 0 = no schedule.
                          nullable: true
                        raw:
                          type: object
                          description: >-
                            The unprocessed upstream data-API record (only when
                            requested with `raw=true`).
                          properties: {}
                          additionalProperties: true
                      required:
                        - index
                        - from
                        - to
                        - symbol
                        - groupIndex
                        - isPairListed
                        - closeOnly
                        - leverages
                        - pairMinLevPosUSDC
                        - pairOI
                        - pairMaxOI
                        - maxWalletOI
        '400':
          description: >-
            Invalid input (failed schema validation or pre-trade checks like
            liquidity, leverage bounds, min position size, or market hours).
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - error
                properties:
                  ok:
                    type: boolean
                    enum:
                      - false
                    description: Always `false` on errors.
                  error:
                    type: object
                    required:
                      - code
                      - message
                    description: Machine-readable error.
                    properties:
                      code:
                        type: string
                        enum:
                          - BAD_REQUEST
                        description: Stable error code for programmatic handling.
                      message:
                        type: string
                        description: Human-readable explanation of what went wrong.
                      details:
                        description: >-
                          Optional structured context — e.g. Zod validation
                          issues on BAD_REQUEST, or `{ target, revertData,
                          decodedError }` on SIMULATION_FAILED.

````