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

# Get Trading Limits

> Provides real-time trading limits based on global, user, and asset-specific exposure limits.

Limits:
- The "Max Notional Value" limit is based on the dollar value of outstanding attestations. That is, if a user has a limit of \$1,000,000, and has 30 non-expired, non-filled attestations at a value of \$999,000, they will not be able to request another attestation for \$1000.
- The "Remaining Attestations" limits the number of non-expired, non-executed attestations. For example if the limit is 50, and a user has 50 outstanding attestations, they must wait for one to execute or expire before requesting another.

If the market is closed or paused, the response will indicate that trading is not allowed and provide the reason. For more information on market hours, see the `/v1/status/market` endpoint.

**Trading Limits Reason Codes**

When trading is not allowed, the response will include a `reason` field which may include one of the following common codes:
- `MARKET_CLOSED`: Market is closed.
- `MARKET_PAUSED`: Market is temporarily paused.
- `ASSET_PAUSED`: Specific asset is paused.
- `ASSET_CLOSED_FOR_SESSION`: The asset is not tradable in this session (e.g., not available overnight; see [Get Market Data](https://docs.ondo.finance/api-reference/assets/get-market-data-for-all-supported-assets))
- `ASSET_LIMITED`: Asset can be traded, but order size is more limited than usual.
- `MAX_LIMIT_REACHED`: Maximum limit has been reached.
- `MAX_ATTESTATIONS`: Maximum attestations reached.

For caching details on this endpoint, please see: [Endpoint Caching](https://docs.ondo.finance/api-reference/endpoint-caching).




## OpenAPI

````yaml /gm-be-api-spec.json get /v1/limits/trading
openapi: 3.0.4
info:
  title: GM Backend API
  description: An API spec for the Ondo GM Backend API.
  version: 1.0.0
servers:
  - url: https://api.gm.ondo.finance
    description: GM Backend API
security: []
tags:
  - name: Attestations
    description: Get Mint and Redeem Attestations
  - name: Assets
    description: Get Asset Price Information
  - name: Tickers
    description: Get Ticker Information
  - name: Chains
    description: Get On Chain Data
  - name: Limits
    description: Get Trading Limits
  - name: Status
    description: Get Market and Trading Statuses
paths:
  /v1/limits/trading:
    get:
      tags:
        - Limits
      summary: Get Trading Limits
      description: >
        Provides real-time trading limits based on global, user, and
        asset-specific exposure limits.


        Limits:

        - The "Max Notional Value" limit is based on the dollar value of
        outstanding attestations. That is, if a user has a limit of \$1,000,000,
        and has 30 non-expired, non-filled attestations at a value of \$999,000,
        they will not be able to request another attestation for \$1000.

        - The "Remaining Attestations" limits the number of non-expired,
        non-executed attestations. For example if the limit is 50, and a user
        has 50 outstanding attestations, they must wait for one to execute or
        expire before requesting another.


        If the market is closed or paused, the response will indicate that
        trading is not allowed and provide the reason. For more information on
        market hours, see the `/v1/status/market` endpoint.


        **Trading Limits Reason Codes**


        When trading is not allowed, the response will include a `reason` field
        which may include one of the following common codes:

        - `MARKET_CLOSED`: Market is closed.

        - `MARKET_PAUSED`: Market is temporarily paused.

        - `ASSET_PAUSED`: Specific asset is paused.

        - `ASSET_CLOSED_FOR_SESSION`: The asset is not tradable in this session
        (e.g., not available overnight; see [Get Market
        Data](https://docs.ondo.finance/api-reference/assets/get-market-data-for-all-supported-assets))

        - `ASSET_LIMITED`: Asset can be traded, but order size is more limited
        than usual.

        - `MAX_LIMIT_REACHED`: Maximum limit has been reached.

        - `MAX_ATTESTATIONS`: Maximum attestations reached.


        For caching details on this endpoint, please see: [Endpoint
        Caching](https://docs.ondo.finance/api-reference/endpoint-caching).
      operationId: getTradingLimits
      parameters:
        - name: symbol
          in: query
          description: The GM token symbol.
          example: AAPLon
          required: true
          schema:
            type: string
        - name: side
          in: query
          description: The trade side
          example: buy
          required: true
          schema:
            $ref: '#/components/schemas/SideEnum'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradingLimitsResponse'
        '400':
          description: >-
            One of the request parameters is invalid. Please see the returned
            message and documentation for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: One of the request parameters is invalid.
                    documentation: https://docs.ondo.finance/api-reference/error-codes
                    code: INVALID_SYMBOL
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: missing API key
                    code: MISSING_API_KEY
        '403':
          description: Trading is restricted due to market or asset state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                market_closed:
                  summary: Market Closed
                  value:
                    code: MARKET_CLOSED
                    message: market is closed
                    documentation: https://docs.ondo.finance/api-reference/error-codes
                asset_paused:
                  summary: Asset Paused
                  value:
                    code: ASSET_PAUSED
                    message: asset trading is paused
                    documentation: https://docs.ondo.finance/api-reference/error-codes
        '500':
          description: >-
            An internal server error occurred. Please see the returned message
            and documentation for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                error:
                  value:
                    message: >-
                      An internal server error occurred. Please see the returned
                      message and documentation for details.
                    code: INTERNAL_ERROR
      security:
        - apiKey: []
components:
  schemas:
    SideEnum:
      type: string
      description: The direction of the trade.
      enum:
        - buy
        - sell
    TradingLimitsResponse:
      type: object
      properties:
        timestamp:
          type: number
          description: >-
            The Unix timestamp in milliseconds when the trading limits were last
            updated.
          example: 1746655938000
        symbol:
          type: string
          example: AAPLon
          description: The GM token symbol.
        side:
          $ref: '#/components/schemas/SideEnum'
        maxTokens:
          type: string
          description: >-
            The maximum token amount available to trade, represented as a
            string-encoded decimal with up to 18 digits after the decimal point.
          example: '100.000000000000000000'
        maxNotionalValue:
          type: string
          description: >-
            The maximum notional value available to trade, represented as a
            string-encoded decimal with up to 18 digits after the decimal point.
          example: '1234.560000000000000000'
        remainingAttestations:
          type: string
          description: The number of remaining attestations for this asset.
          example: '3'
        isAssetTradingOpen:
          type: boolean
          description: Indicates whether the user is currently allowed to trade the asset
          example: false
        reason:
          $ref: '#/components/schemas/TradingLimitsReason'
      required:
        - timestamp
        - symbol
        - side
        - maxTokens
        - maxNotionalValue
        - remainingAttestations
        - isAssetTradingOpen
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable message providing more details about the error.
        documentation:
          type: string
          description: A URL to the relevant documentation for this error.
        code:
          type: string
          description: >-
            A reason code identifying the specific type of error. See the Error
            Codes reference for a full list of possible values.
      required:
        - code
        - message
    TradingLimitsReason:
      description: Reason why trading is restricted for the given asset and user.
      allOf:
        - $ref: '#/components/schemas/ReasonBase'
        - type: object
          properties:
            code:
              $ref: '#/components/schemas/TradingLimitsReasonCode'
          required:
            - code
    ReasonBase:
      type: object
      properties:
        message:
          type: string
          description: The human-readable message describing the reason
          example: Weekend/Holiday
        documentation:
          type: string
          description: Additional documentation or reference
          example: https://docs.ondo.finance/
      required:
        - message
        - documentation
    TradingLimitsReasonCode:
      type: string
      enum:
        - MARKET_CLOSED
        - MARKET_PAUSED
        - ASSET_PAUSED
        - ASSET_CLOSED_FOR_SESSION
        - ASSET_LIMITED
        - MAX_LIMIT_REACHED
        - MAX_ATTESTATIONS
      description: The code indicating why trading is not allowed.
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header

````