> ## 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 market trigger orders (orderbook)

> Aggregated trigger orders on a market — feeds the public orderbook view.
Closed/liquidated positions' stale TP/SL orders are filtered out.

When `pivot` is provided, results are sorted by absolute distance from the pivot
(closest first) so a clipped `limit` returns a balanced bids+asks slice instead
of N rows from a single tail. The final response is then sorted by `trigger_price`
descending for stable client rendering.




## OpenAPI

````yaml openapi-spec/history.yaml get /api/sol/perp/markets/{market_id}/orders
openapi: 3.0.3
info:
  title: Raze Database API
  description: >
    Paid subscription API for Solana transaction data and history.


    Also hosts write utilities (`/utils/sol/*`): token launch, transfer, burn,

    consolidate, fees claim/config, and agent initialize — previously on

    `router.raze.bot`. Mixer/distribute removed 2026-07-25.


    ## Batch Requests

    All endpoints with path parameters (mint, signer, address, tokenMint,
    ownerAddress) support batch queries

    via comma-separated values. For example:
    `/api/sol/trades/mint/mint1,mint2,mint3?limit=50`


    - Maximum 10 values per batch request

    - Each value must be a valid address (>= 32 characters)

    - Single values behave identically to non-batch requests

    - Batch response format: `{ "success": true, "results": { "value1": {...},
    "value2": {...} }, "count": N, "timestamp": "..." }`

    - Each key in `results` contains the full single-entity response

    - Queries run in parallel for maximum performance
  version: 1.0.0
servers:
  - url: https://api.raze.bot
    description: >-
      Raze global History API — GeoDNS routes to the nearest region
      automatically
security:
  - ApiKeyAuth: []
paths:
  /api/sol/perp/markets/{market_id}/orders:
    get:
      summary: Perp market trigger orders (orderbook)
      description: >
        Aggregated trigger orders on a market — feeds the public orderbook view.

        Closed/liquidated positions' stale TP/SL orders are filtered out.


        When `pivot` is provided, results are sorted by absolute distance from
        the pivot

        (closest first) so a clipped `limit` returns a balanced bids+asks slice
        instead

        of N rows from a single tail. The final response is then sorted by
        `trigger_price`

        descending for stable client rendering.
      operationId: getPerpMarketOrders
      parameters:
        - name: market_id
          in: path
          required: true
          schema:
            type: string
          example: jup:SOL-PERP
        - name: state
          in: query
          schema:
            type: string
            enum:
              - open
              - filled
              - cancelled
              - all
            default: open
        - name: pivot
          in: query
          schema:
            type: number
          description: Pivot price (USDC, decimal) — closest orders first when set.
        - name: from
          in: query
          schema:
            type: integer
            format: int64
        - name: to
          in: query
          schema:
            type: integer
            format: int64
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 2000
            default: 500
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerpOrdersResponse'
components:
  schemas:
    PerpOrdersResponse:
      type: object
      properties:
        market_id:
          type: string
          description: >-
            Present on market scope; absent on wallet scope (where `address` is
            returned instead).
        address:
          type: string
          description: Present on wallet scope.
        data:
          type: array
          items:
            $ref: '#/components/schemas/PerpOrder'
        count:
          type: integer
    PerpOrder:
      type: object
      properties:
        order_id:
          type: string
        owner:
          type: string
        market_id:
          type: string
        venue:
          type: string
        position_pubkey:
          type: string
        kind:
          type: string
          description: >-
            Order kind (e.g. trigger / take-profit / stop-loss as decoded from
            venue).
        side:
          type: string
          enum:
            - long
            - short
        state:
          type: string
          enum:
            - open
            - updated
            - filled
            - cancelled
        size_usd:
          type: integer
          format: int64
        collateral:
          type: integer
          format: int64
        trigger_price:
          type: integer
          format: int64
          description: Trigger price in USD micros (1e6 = $1).
        trigger_above:
          type: boolean
        entire_position:
          type: boolean
        created_slot:
          type: integer
          format: int64
        created_ts:
          type: integer
          format: int64
        updated_slot:
          type: integer
          format: int64
        updated_ts:
          type: integer
          format: int64
        last_signature:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: apiKey

````