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

# List perpetual trading markets

> List available perpetual trading markets with key metrics.

Returns perp markets (stocks, commodities, forex) with open interest,
24h volume, funding rate, and max leverage. Supports filtering by category,
minimum OI/volume, and sorting.

Only perpetual trading assets are returned — crypto perps are excluded.



## OpenAPI

````yaml /v2/combined_spec.json get /v2/perpetual_trading/opportunities
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v2/perpetual_trading/opportunities:
    get:
      tags:
        - Perpetual Trading
      summary: List perpetual trading markets
      description: >-
        List available perpetual trading markets with key metrics.


        Returns perp markets (stocks, commodities, forex) with open interest,

        24h volume, funding rate, and max leverage. Supports filtering by
        category,

        minimum OI/volume, and sorting.


        Only perpetual trading assets are returned — crypto perps are excluded.
      operationId: v2_perpetual_trading_opportunities
      parameters:
        - name: min_open_interest
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            title: Min Open Interest
            default: null
          description: Filter by minimum open interest in USD
        - name: min_volume_24h
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            title: Min Volume 24H
            default: null
          description: Filter by minimum 24h volume in USD
        - name: category
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/PerpetualTradingCategory'
              - type: 'null'
            title: Category
            default: null
          description: 'Filter by asset category: stock, commodity, forex'
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - open_interest
              - volume_24h
              - funding_rate
            title: PerpetualTradingSortBy
            default: volume_24h
          description: Sort results by this field
        - name: sort_order
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            title: PerpetualTradingSortOrder
            default: desc
          description: Sort direction
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerpetualTradingOpportunitiesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            from compass_api_sdk import CompassAPI, models


            with CompassAPI(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as compass_api:

                res = compass_api.perpetual_trading.perpetual_trading_opportunities(sort_by=models.PerpetualTradingSortBy.VOLUME_24H, sort_order=models.PerpetualTradingSortOrder.DESC)

                # Handle response
                print(res)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { CompassApiSDK } from "@compass-labs/api-sdk";

            const compassApiSDK = new CompassApiSDK({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await compassApiSDK.perpetualTrading.perpetualTradingOpportunities({
                sortBy: "volume_24h",
                sortOrder: "desc",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    PerpetualTradingCategory:
      type: string
      enum:
        - stock
        - commodity
        - forex
      title: PerpetualTradingCategory
    PerpetualTradingOpportunitiesResponse:
      properties:
        opportunities:
          items:
            $ref: '#/components/schemas/PerpetualTradingOpportunity'
          type: array
          title: Opportunities
          description: Available perpetual trading markets
      type: object
      required:
        - opportunities
      title: PerpetualTradingOpportunitiesResponse
      description: List of available perpetual trading markets.
      example:
        opportunities:
          - asset: AAPL
            asset_id: 12
            category: stock
            funding_rate: '0.0000125'
            mark_price: '213.88'
            max_leverage: 5
            open_interest: '8421530.50'
            oracle_price: '213.80'
            sz_decimals: 2
            volume_24h: '12498230.75'
          - asset: GOLD
            asset_id: 3
            category: commodity
            funding_rate: '-0.0000040'
            mark_price: '2438.20'
            max_leverage: 10
            open_interest: '5102330.10'
            oracle_price: '2438.05'
            sz_decimals: 3
            volume_24h: '9874120.40'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PerpetualTradingOpportunity:
      properties:
        asset:
          type: string
          title: Asset
          description: Asset ticker symbol (e.g. AAPL, GOLD, EUR)
        asset_id:
          type: integer
          title: Asset Id
          description: Hyperliquid asset index
        category:
          type: string
          title: Category
          description: 'Asset category: stock, commodity, forex'
        mark_price:
          type: string
          title: Mark Price
          description: Current mark price
        oracle_price:
          type: string
          title: Oracle Price
          description: Oracle reference price
        open_interest:
          type: string
          title: Open Interest
          description: Open interest in USD
        volume_24h:
          type: string
          title: Volume 24H
          description: 24-hour trading volume in USD
        funding_rate:
          type: string
          title: Funding Rate
          description: Current hourly funding rate
        max_leverage:
          type: integer
          title: Max Leverage
          description: Maximum allowed leverage
        sz_decimals:
          type: integer
          title: Sz Decimals
          description: Size decimal places for order quantities
      type: object
      required:
        - asset
        - asset_id
        - category
        - mark_price
        - oracle_price
        - open_interest
        - volume_24h
        - funding_rate
        - max_leverage
        - sz_decimals
      title: PerpetualTradingOpportunity
      description: A single perpetual trading market.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````