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

# Perp markets

> The markets of every enabled venue (or of the one asked), with the live mark price.

- **Jupiter**: three markets, `SOL`, `ETH`, `BTC`. Longs are collateralised in the asset, shorts
  in USDC. The mark is Jupiter's Doves oracle.
- **GMTrade**: the markets of its catalog that the venue has enabled. The mark is the latest
  Chainlink Data Streams report published on chain; it is omitted when that report is older
  than the token's heartbeat (120 s for most tokens, 300 s for FX, metals and oil, 30 s for
  PUMP): outside market hours for stocks and FX, and whenever a feed lags.

A market without `mark` cannot be quoted or opened right now: `/perp/quote` and
`/perp/instructions` decline it with `503 oracle`.


Guide: [Perps](/router/perps#markets).


## OpenAPI

````yaml perp.openapi.yaml GET /perp/markets
openapi: 3.1.0
info:
  title: Raze Router Perps API
  version: 1.0.0
  description: >
    Perpetual futures on Solana through the router: live markets, quotes,
    unsigned

    transactions and the live state of a wallet, on **Jupiter Perps**
    (`jupiter`) and **GMTrade**

    (gmsol / GMX-Solana, `gmtrade`).


    **The router never signs and never sends.** `POST /perp/instructions`
    returns the instructions

    and, on request, the serialized unsigned transaction; your backend has the
    wallet sign it and

    broadcasts it.


    **One operation, one transaction.** The collateral deposit travels in the
    same transaction as the

    order, and when the wallet pays with another token (`fundingMint`) an
    exact-out swap route into the

    collateral mint is placed in front of the venue instruction, in that same
    transaction.


    **Execution is asynchronous on both venues.** The transaction creates a
    request (Jupiter) or an

    order (GMTrade); the venue's keeper executes it afterwards in its own
    transaction, at its own

    oracle price. Watch `GET /perp/account` (or the chain) to see the fill.


    **Conventions, everywhere:**

    - Perps are off until you enable them: `ROUTER_PERP=jupiter,gmtrade` (or
    `all`) in the router's
      environment. A venue that is off answers `422 venue_disabled`.
    - Market ids are `<venue>:<SYMBOL>-PERP`, e.g. `jupiter:SOL-PERP`,
    `gmtrade:SOL-WSOL-USDC-PERP`.
      Case-insensitive; `-PERP` is optional; `jup:`, `gmsol:` and `gm:` are accepted as aliases.
    - USD amounts are integers in micro-USD: fields ending in `Usd` (requests)
    and `UsdE6`
      (responses), so `10000000` is $10.
    - Prices are integers, USD per whole token × 10^6 (`priceE6`,
    `triggerPriceE6`).

    - Leverage and shares are basis points: `leverageBps` 20000 = 2x, `closeBps`
    10000 = all.

    - Token amounts (`collateralAmount`, `amountIn`…) are raw base units of the
    mint.

    - Amounts and prices are JSON integers (send them as numbers, not strings).
    A response field
      that does not apply is omitted, except in `/perp/account` where an unknown value is `null`.
    - Times are Unix **seconds**.

    - Failure: `{"error": "<label>", "reason": "<text>", "quoteId": "<id>"}`.
    The status says whose
      fault it is: 400 the request, 409 re-quote, 422 a named decline, 503 the router or the chain.
      A body over 256 KiB is refused with 413; an unknown route answers 404 `not_found`.

    **On `https://router.raze.bot` perps are not enabled:** `GET /perp/markets`
    lists no venue and

    every operation answers `422 venue_disabled`. They work on a router of your
    own with

    `ROUTER_PERP` set.


    **No authentication.** A router you run yourself listens on loopback
    (`ROUTER_LISTEN`, default

    `127.0.0.1:4700`) and trusts its caller; put your own auth in front of it if
    you expose it.
servers:
  - url: https://router.raze.bot
    description: Raze's public router (perps not enabled)
  - url: http://127.0.0.1:4700
    description: Your own router (default ROUTER_LISTEN)
security: []
tags:
  - name: markets
    description: Live perp markets per venue
  - name: trading
    description: Quotes and unsigned transactions for every perp operation
  - name: account
    description: Live positions and resting orders of a wallet
paths:
  /perp/markets:
    get:
      tags:
        - markets
      summary: Perp markets
      description: >
        The markets of every enabled venue (or of the one asked), with the live
        mark price.


        - **Jupiter**: three markets, `SOL`, `ETH`, `BTC`. Longs are
        collateralised in the asset, shorts
          in USDC. The mark is Jupiter's Doves oracle.
        - **GMTrade**: the markets of its catalog that the venue has enabled.
        The mark is the latest
          Chainlink Data Streams report published on chain; it is omitted when that report is older
          than the token's heartbeat (120 s for most tokens, 300 s for FX, metals and oil, 30 s for
          PUMP): outside market hours for stocks and FX, and whenever a feed lags.

        A market without `mark` cannot be quoted or opened right now:
        `/perp/quote` and

        `/perp/instructions` decline it with `503 oracle`.
      operationId: listPerpMarkets
      parameters:
        - name: venue
          in: query
          description: >-
            Only this venue. Aliases `jup`, `gmsol` and `gm` are accepted. Omit
            for every enabled venue
          schema:
            type: string
            enum:
              - jupiter
              - gmtrade
      responses:
        '200':
          description: Markets per venue. With no venue enabled, `venues` is empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketsResponse'
              example:
                quoteId: 38a66df90000000f
                venues:
                  - venue: jupiter
                    ready: true
                    markets:
                      - marketId: jupiter:SOL-PERP
                        venue: jupiter
                        symbol: SOL
                        collateralMintLong: So11111111111111111111111111111111111111112
                        collateralMintShort: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        mark:
                          priceE6: 117432055
                          slot: 452412207
                          publishTime: 1790891137
                          source: doves
                        openFeePpm: 600
                        isolatedOnly: false
                      - marketId: jupiter:ETH-PERP
                        venue: jupiter
                        symbol: ETH
                        collateralMintLong: 7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs
                        collateralMintShort: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        mark:
                          priceE6: 2689357665
                          slot: 452412207
                          publishTime: 1790891137
                          source: doves
                        openFeePpm: 600
                        isolatedOnly: false
                      - marketId: jupiter:BTC-PERP
                        venue: jupiter
                        symbol: BTC
                        collateralMintLong: 3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh
                        collateralMintShort: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        mark:
                          priceE6: 84468816646
                          slot: 452412207
                          publishTime: 1790891137
                          source: doves
                        openFeePpm: 600
                        isolatedOnly: false
                  - venue: gmtrade
                    ready: true
                    markets:
                      - marketId: gmtrade:BTC-USDC-USDC-PERP
                        venue: gmtrade
                        symbol: BTC-USDC-USDC
                        collateralMintLong: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        collateralMintShort: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        mark:
                          priceE6: 84466904622
                          slot: 452412209
                          publishTime: 1790891132
                          source: chainlink
                        isolatedOnly: true
                      - marketId: gmtrade:SOL-WSOL-USDC-PERP
                        venue: gmtrade
                        symbol: SOL-WSOL-USDC
                        collateralMintLong: So11111111111111111111111111111111111111112
                        collateralMintShort: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        mark:
                          priceE6: 117427558
                          slot: 452412209
                          publishTime: 1790891134
                          source: chainlink
                        isolatedOnly: true
                      - marketId: gmtrade:XAU-PERP
                        venue: gmtrade
                        symbol: XAU
                        collateralMintLong: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        collateralMintShort: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        isolatedOnly: true
                      - marketId: gmtrade:ZEC-PERP
                        venue: gmtrade
                        symbol: ZEC
                        collateralMintLong: 9wX6Qz1Y5YQe71dfnFYFfZYXZhKqjYKQwdqfrRkmYUSX
                        collateralMintShort: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                        isolatedOnly: true
        '400':
          description: '`venue` is not a perp venue'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: bad_request
                reason: 'venue: jupiter | gmtrade'
                quoteId: 23e14e01000044fa
        '422':
          $ref: '#/components/responses/VenueDisabled'
        '503':
          $ref: '#/components/responses/NotReady'
components:
  schemas:
    MarketsResponse:
      type: object
      required:
        - quoteId
        - venues
      properties:
        quoteId:
          type: string
        venues:
          type: array
          items:
            $ref: '#/components/schemas/VenueMarkets'
    Error:
      type: object
      required:
        - error
        - reason
      properties:
        error:
          type: string
          description: >
            The label. 400: `bad_request`, `unknown_market`, `request` (the
            order named cannot be acted

            on), `invalid_route_ticket`, `route_ticket_mismatch`. 404:
            `not_found`. 409:

            `route_expired`. 422: `venue_disabled`, `venue_form`, `no_position`,
            `size`, `layout`,

            `wire`, `declined`. 503: `missing_state`, `oracle`, `rpc`,
            `declined` (funding route accounts

            could not be fetched). 500: `internal`.
          enum:
            - bad_request
            - unknown_market
            - request
            - invalid_route_ticket
            - route_ticket_mismatch
            - not_found
            - route_expired
            - venue_disabled
            - venue_form
            - no_position
            - size
            - layout
            - wire
            - declined
            - missing_state
            - oracle
            - rpc
            - internal
        reason:
          type: string
          description: What exactly; free text for humans and logs
        quoteId:
          type: string
          description: >-
            Id of this call in the router's logs (16 hex). Absent when the body
            does not parse
          example: 94c3676a00000002
    VenueMarkets:
      type: object
      required:
        - venue
        - ready
        - markets
      properties:
        venue:
          type: string
          enum:
            - jupiter
            - gmtrade
        ready:
          type: boolean
          description: >-
            `false` when the venue's state could not be loaded; `markets` is
            then empty
        reason:
          type: string
          description: >-
            Why `ready` is false, or that a refresh failed and the router serves
            what it has
        markets:
          type: array
          items:
            $ref: '#/components/schemas/Market'
    NotReady:
      type: object
      required:
        - error
        - reasons
      properties:
        error:
          type: string
          const: not_ready
        reasons:
          type: array
          items:
            type: string
          description: Every reason the router is not ready
        quoteId:
          type: string
    Market:
      type: object
      required:
        - marketId
        - venue
        - symbol
        - collateralMintLong
        - collateralMintShort
        - isolatedOnly
      properties:
        marketId:
          type: string
          example: gmtrade:SOL-WSOL-USDC-PERP
        venue:
          type: string
          enum:
            - jupiter
            - gmtrade
        symbol:
          type: string
          description: >-
            The venue's symbol. On GMTrade the index token when it has one
            market (`ZEC`), else `INDEX-LONG-SHORT` (`SOL-WSOL-USDC`)
        collateralMintLong:
          type: string
          description: Mint an `open` long deposits
        collateralMintShort:
          type: string
          description: Mint an `open` short deposits
        mark:
          $ref: '#/components/schemas/Mark'
          description: >-
            Omitted when the router has no fresh price: such a market cannot be
            quoted now
        maxLeverageBps:
          type: integer
          description: >-
            Reserved; not emitted by either venue today (the router does not cap
            leverage)
        openFeePpm:
          type: integer
          description: >-
            Opening fee in parts per million of the notional (Jupiter only; 600
            = 0.06 %)
        isolatedOnly:
          type: boolean
          description: '`true` on GMTrade, `false` on Jupiter'
    Mark:
      type: object
      description: The reference price of the market's index token
      required:
        - priceE6
        - slot
        - source
      properties:
        priceE6:
          type: integer
          format: int64
          description: USD per whole token × 10^6
          example: 117432055
        slot:
          type: integer
          format: int64
          description: Slot of the oracle account the price was read from
        publishTime:
          type: integer
          format: int64
          description: >-
            When the price was published, Unix seconds. On GMTrade the older of
            the report's signing and its landing
        source:
          type: string
          enum:
            - doves
            - chainlink
          description: >-
            `doves` (Jupiter's oracle) or `chainlink` (GMTrade's Chainlink Data
            Streams feed)
  responses:
    VenueDisabled:
      description: The venue asked is not enabled on this router (`ROUTER_PERP`)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: venue_disabled
            reason: jupiter is not enabled on this host (ROUTER_PERP)
            quoteId: 23e14e01000044f9
    NotReady:
      description: >-
        The router is not ready (cold start, stream down, swap config not read);
        `reasons` says why
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotReady'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.