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

# Order operations

> > **Endpoint:** `wss://api.testnet.arcus.xyz/v1/ws` — one socket multiplexes every channel and RPC request. Click **Connect**, then send the example subscribe message below to start receiving data.

RPC-style trading operations over WebSocket. Use `type: post` for order mutations and `type: get` for read-only snapshots.

Every request carries a client-chosen numeric `id` that is echoed in the response, allowing you to correlate replies with requests. Use a monotonically increasing counter per connection.

**Order mutations are asynchronous** — they reply with `status: 202` (accepted, not terminal). Subscribe to `orders` and `userFills` to observe the full order lifecycle.

**Supported `post` methods:** `placeOrder`, `cancelOrder`, `cancelAllOrders`, `modifyOrder`, `batchPlaceOrders`, `batchCancelOrders`, `setLeverage`.

**Supported `get` methods:** `l2orderbook`, `bbo`, `mids`, `account`, `fills`, `orders`, `markets`, `prices`, `positions`, `ratelimit`.




## AsyncAPI

````yaml api-reference/asyncapi.yaml orderOperations
id: orderOperations
title: Order operations
description: >
  > **Endpoint:** `wss://api.testnet.arcus.xyz/v1/ws` — one socket multiplexes
  every channel and RPC request. Click **Connect**, then send the example
  subscribe message below to start receiving data.


  RPC-style trading operations over WebSocket. Use `type: post` for order
  mutations and `type: get` for read-only snapshots.


  Every request carries a client-chosen numeric `id` that is echoed in the
  response, allowing you to correlate replies with requests. Use a monotonically
  increasing counter per connection.


  **Order mutations are asynchronous** — they reply with `status: 202`
  (accepted, not terminal). Subscribe to `orders` and `userFills` to observe the
  full order lifecycle.


  **Supported `post` methods:** `placeOrder`, `cancelOrder`, `cancelAllOrders`,
  `modifyOrder`, `batchPlaceOrders`, `batchCancelOrders`, `setLeverage`.


  **Supported `get` methods:** `l2orderbook`, `bbo`, `mids`, `account`, `fills`,
  `orders`, `markets`, `prices`, `positions`, `ratelimit`.
servers:
  - id: testnet
    protocol: wss
    host: api.testnet.arcus.xyz
    bindings: []
    variables: []
  - id: mainnet
    protocol: wss
    host: api.arcus.xyz
    bindings: []
    variables: []
address: /v1/ws?channel=orderOperations
parameters: []
bindings: []
operations:
  - &ref_5
    id: sendOrderOperation
    title: Send order operation
    type: receive
    messages:
      - &ref_7
        id: placeOrder
        contentType: application/json
        payload:
          - name: Place Order
            type: object
            properties:
              - name: type
                type: string
                description: post
                required: true
              - name: id
                type: integer
                description: Client-chosen request id, echoed in the response.
                required: true
              - name: request
                type: object
                required: true
                properties:
                  - name: apiKey
                    type: string
                    description: Ed25519 public key (64 hex characters).
                    required: true
                  - name: timestamp
                    type: string
                    description: >
                      Unix epoch nanoseconds as a string. Millisecond or second
                      epochs are rejected with `401`; must be within ±30s of
                      server wall-clock.
                    required: true
                  - name: signature
                    type: string
                    description: >
                      Ed25519 signature (128 hex characters). For `placeOrder`,
                      `cancelOrder`, and `modifyOrder` sign the **typed
                      canonical payload** (the JSON object IS the signing
                      message). For legacy methods (`cancelAllOrders`,
                      `setLeverage`) sign `timestamp + action +
                      canonicalJSON(request.payload)` where `action` is the
                      canonical camelCase method name.
                    required: true
                  - name: type
                    type: string
                    description: placeOrder
                    required: true
                  - name: payload
                    type: object
                    description: >
                      A single order. Identical shape to the `placeOrder`
                      payload and to each element of a `batchPlaceOrders`
                      `orders` array.
                    required: true
                    properties:
                      - name: address
                        type: string
                        description: >-
                          Master EVM address; must match the API key's master
                          account.
                        required: true
                      - name: accountIndex
                        type: integer
                        description: Subaccount index (0–9).
                        required: true
                      - name: marketId
                        type: integer
                        description: Market enum (e.g. 1 = BTC-USD, 2 = ETH-USD).
                        required: true
                      - name: orderSide
                        type: string
                        enumValues:
                          - BUY
                          - SELL
                        required: true
                      - name: orderType
                        type: string
                        description: >
                          Execution style. TPSL trigger orders are still `LIMIT`
                          or `MARKET` here — the trigger semantics come from
                          `tpslType` + `stopPrice`.
                        enumValues:
                          - LIMIT
                          - MARKET
                        required: true
                      - name: timeInForce
                        type: string
                        description: >-
                          GTC = Good Till Canceled, IOC = Immediate or Cancel,
                          FOK = Fill or Kill, ALO = Add Liquidity Only
                          (post-only). Reduce-only non-TPSL orders must be IOC
                          or FOK.
                        enumValues:
                          - GTC
                          - IOC
                          - FOK
                          - ALO
                        required: true
                      - name: quantity
                        type: string
                        description: Order size in base asset, human-readable decimal.
                        required: true
                      - name: price
                        type: string
                        description: >-
                          Human-readable decimal price. Required for `LIMIT`
                          orders (resting limit price) and for **all** `MARKET`
                          orders (protective slippage bound). For plain `MARKET`
                          orders the value must be a positive decimal within
                          **10% of the current mark price**; orders outside this
                          band are rejected with
                          `MarketPriceSlippageToleranceTooHigh`. For TPSL
                          `MARKET` orders the value must be within **10% of
                          `stopPrice`** (trigger price) — at trigger time the
                          mark price ≈ stopPrice, so this enforces the same ±10%
                          slippage protection.
                        required: false
                      - name: clientId
                        type: string
                        description: >-
                          Optional client-supplied order id (idempotency /
                          cancel-by-clientId).
                        required: false
                      - name: clientTime
                        type: string
                        description: >-
                          Optional client timestamp (unix epoch ms, as a
                          string).
                        required: false
                      - name: reduceOnly
                        type: boolean
                        description: >-
                          If true, the order can only reduce an existing
                          position.
                        required: false
                      - name: minSize
                        type: string
                        description: Optional minimum fill size, human-readable decimal.
                        required: false
                      - name: stopPrice
                        type: string
                        description: >-
                          Trigger price for TPSL orders, human-readable decimal.
                          Required when `tpslType` is set.
                        required: false
                      - name: tpslType
                        type: string
                        description: >-
                          Marks the order as a take-profit / stop-loss trigger
                          order. Omit for plain orders.
                        enumValues:
                          - STOP_LOSS
                          - TAKE_PROFIT
                        required: false
                      - name: fillMode
                        type: string
                        description: Optional fill-mode hint.
                        required: false
                      - name: signature
                        type: string
                        description: >
                          Per-order Ed25519 signature (128 hex), REQUIRED when
                          this order is an element of a `batchPlaceOrders`
                          array, omitted for single `placeOrder`. Signed over
                          the typed canonical `placeOrder` payload (op=1; op=4
                          for TPSL legs) — identical to the bytes signed for a
                          standalone `placeOrder`. The shared `timestamp`
                          envelope value is the `ct` field inside the payload.
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - id
            - request
          properties:
            type:
              type: string
              const: post
              x-parser-schema-id: <anonymous-schema-190>
            id:
              type: integer
              description: Client-chosen request id, echoed in the response.
              example: 1
              x-parser-schema-id: <anonymous-schema-191>
            request:
              allOf:
                - &ref_0
                  type: object
                  description: Signing fields required for all order mutation requests.
                  required:
                    - apiKey
                    - timestamp
                    - signature
                  properties:
                    apiKey:
                      type: string
                      description: Ed25519 public key (64 hex characters).
                      example: <64-hex-public-key>
                      x-parser-schema-id: <anonymous-schema-193>
                    timestamp:
                      type: string
                      description: >
                        Unix epoch nanoseconds as a string. Millisecond or
                        second epochs are rejected with `401`; must be within
                        ±30s of server wall-clock.
                      example: '1712345678000000000'
                      x-parser-schema-id: <anonymous-schema-194>
                    signature:
                      type: string
                      description: >
                        Ed25519 signature (128 hex characters). For
                        `placeOrder`, `cancelOrder`, and `modifyOrder` sign the
                        **typed canonical payload** (the JSON object IS the
                        signing message). For legacy methods (`cancelAllOrders`,
                        `setLeverage`) sign `timestamp + action +
                        canonicalJSON(request.payload)` where `action` is the
                        canonical camelCase method name.
                      example: <128-hex-signature>
                      x-parser-schema-id: <anonymous-schema-195>
                  x-parser-schema-id: SignedRequest
                - type: object
                  required:
                    - type
                    - payload
                  properties:
                    type:
                      type: string
                      const: placeOrder
                      x-parser-schema-id: <anonymous-schema-197>
                    payload: &ref_1
                      type: object
                      description: >
                        A single order. Identical shape to the `placeOrder`
                        payload and to each element of a `batchPlaceOrders`
                        `orders` array.
                      required:
                        - address
                        - accountIndex
                        - marketId
                        - orderSide
                        - orderType
                        - timeInForce
                        - quantity
                      properties:
                        address:
                          type: string
                          description: >-
                            Master EVM address; must match the API key's master
                            account.
                          example: 0x...
                          x-parser-schema-id: <anonymous-schema-198>
                        accountIndex:
                          type: integer
                          minimum: 0
                          maximum: 9
                          description: Subaccount index (0–9).
                          example: 0
                          x-parser-schema-id: <anonymous-schema-199>
                        marketId:
                          type: integer
                          description: Market enum (e.g. 1 = BTC-USD, 2 = ETH-USD).
                          example: 0
                          x-parser-schema-id: <anonymous-schema-200>
                        orderSide:
                          type: string
                          enum:
                            - BUY
                            - SELL
                          x-parser-schema-id: <anonymous-schema-201>
                        orderType:
                          type: string
                          enum:
                            - LIMIT
                            - MARKET
                          description: >
                            Execution style. TPSL trigger orders are still
                            `LIMIT` or `MARKET` here — the trigger semantics
                            come from `tpslType` + `stopPrice`.
                          x-parser-schema-id: <anonymous-schema-202>
                        timeInForce:
                          type: string
                          enum:
                            - GTC
                            - IOC
                            - FOK
                            - ALO
                          description: >-
                            GTC = Good Till Canceled, IOC = Immediate or Cancel,
                            FOK = Fill or Kill, ALO = Add Liquidity Only
                            (post-only). Reduce-only non-TPSL orders must be IOC
                            or FOK.
                          x-parser-schema-id: <anonymous-schema-203>
                        quantity:
                          type: string
                          description: Order size in base asset, human-readable decimal.
                          example: '0.01'
                          x-parser-schema-id: <anonymous-schema-204>
                        price:
                          type: string
                          description: >-
                            Human-readable decimal price. Required for `LIMIT`
                            orders (resting limit price) and for **all**
                            `MARKET` orders (protective slippage bound). For
                            plain `MARKET` orders the value must be a positive
                            decimal within **10% of the current mark price**;
                            orders outside this band are rejected with
                            `MarketPriceSlippageToleranceTooHigh`. For TPSL
                            `MARKET` orders the value must be within **10% of
                            `stopPrice`** (trigger price) — at trigger time the
                            mark price ≈ stopPrice, so this enforces the same
                            ±10% slippage protection.
                          example: '50000'
                          x-parser-schema-id: <anonymous-schema-205>
                        clientId:
                          type: string
                          description: >-
                            Optional client-supplied order id (idempotency /
                            cancel-by-clientId).
                          x-parser-schema-id: <anonymous-schema-206>
                        clientTime:
                          type: string
                          description: >-
                            Optional client timestamp (unix epoch ms, as a
                            string).
                          x-parser-schema-id: <anonymous-schema-207>
                        reduceOnly:
                          type: boolean
                          description: >-
                            If true, the order can only reduce an existing
                            position.
                          x-parser-schema-id: <anonymous-schema-208>
                        minSize:
                          type: string
                          description: Optional minimum fill size, human-readable decimal.
                          x-parser-schema-id: <anonymous-schema-209>
                        stopPrice:
                          type: string
                          description: >-
                            Trigger price for TPSL orders, human-readable
                            decimal. Required when `tpslType` is set.
                          x-parser-schema-id: <anonymous-schema-210>
                        tpslType:
                          type: string
                          enum:
                            - STOP_LOSS
                            - TAKE_PROFIT
                          description: >-
                            Marks the order as a take-profit / stop-loss trigger
                            order. Omit for plain orders.
                          x-parser-schema-id: <anonymous-schema-211>
                        fillMode:
                          type: string
                          description: Optional fill-mode hint.
                          x-parser-schema-id: <anonymous-schema-212>
                        signature:
                          type: string
                          description: >
                            Per-order Ed25519 signature (128 hex), REQUIRED when
                            this order is an element of a `batchPlaceOrders`
                            array, omitted for single `placeOrder`. Signed over
                            the typed canonical `placeOrder` payload (op=1; op=4
                            for TPSL legs) — identical to the bytes signed for a
                            standalone `placeOrder`. The shared `timestamp`
                            envelope value is the `ct` field inside the payload.
                          x-parser-schema-id: <anonymous-schema-213>
                      x-parser-schema-id: OrderRequestItem
                  x-parser-schema-id: <anonymous-schema-196>
              x-parser-schema-id: <anonymous-schema-192>
          x-parser-schema-id: PlaceOrderPayload
        title: Place Order
        example: |-
          {
            "type": "post",
            "id": 1,
            "request": {
              "type": "placeOrder",
              "payload": {
                "address": "0x...",
                "accountIndex": 0,
                "marketId": 1,
                "orderSide": "BUY",
                "orderType": "LIMIT",
                "timeInForce": "GTC",
                "quantity": "0.01",
                "price": "50000"
              },
              "apiKey": "<64-hex-public-key>",
              "timestamp": "1712345678000000000",
              "signature": "<128-hex-signature>"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: placeOrder
      - &ref_8
        id: cancelOrder
        contentType: application/json
        payload:
          - name: Cancel Order
            type: object
            properties:
              - name: type
                type: string
                description: post
                required: true
              - name: id
                type: integer
                required: true
              - name: request
                type: object
                required: true
                properties:
                  - name: apiKey
                    type: string
                    description: Ed25519 public key (64 hex characters).
                    required: true
                  - name: timestamp
                    type: string
                    description: >
                      Unix epoch nanoseconds as a string. Millisecond or second
                      epochs are rejected with `401`; must be within ±30s of
                      server wall-clock.
                    required: true
                  - name: signature
                    type: string
                    description: >
                      Ed25519 signature (128 hex characters). For `placeOrder`,
                      `cancelOrder`, and `modifyOrder` sign the **typed
                      canonical payload** (the JSON object IS the signing
                      message). For legacy methods (`cancelAllOrders`,
                      `setLeverage`) sign `timestamp + action +
                      canonicalJSON(request.payload)` where `action` is the
                      canonical camelCase method name.
                    required: true
                  - name: type
                    type: string
                    description: cancelOrder
                    required: true
                  - name: payload
                    type: object
                    description: >
                      A single cancel. Identical shape to the `cancelOrder`
                      payload and to each element of a `batchCancelOrders`
                      `cancels` array. Provide exactly one of `orderId` or
                      `clientId` (use `kind` to disambiguate when both could
                      apply).
                    required: true
                    properties:
                      - name: address
                        type: string
                        description: >-
                          Master EVM address; must match the API key's master
                          account.
                        required: true
                      - name: accountIndex
                        type: integer
                        description: Subaccount index (0–9).
                        required: true
                      - name: marketId
                        type: integer
                        description: Market enum (e.g. 1 = BTC-USD).
                        required: true
                      - name: kind
                        type: string
                        description: >-
                          Which identifier to cancel by. Defaults to `orderId`
                          when `orderId` is present.
                        enumValues:
                          - orderId
                          - clientId
                        required: false
                      - name: orderId
                        type: string
                        description: >-
                          System order id. One of `orderId` or `clientId` is
                          required.
                        required: false
                      - name: clientId
                        type: string
                        description: Client-supplied order id from the prior `placeOrder`.
                        required: false
                      - name: validUntil
                        type: integer
                        description: Optional expiry for the cancel itself (unix seconds).
                        required: false
                      - name: signature
                        type: string
                        description: >
                          Per-cancel Ed25519 signature (128 hex), REQUIRED when
                          this cancel is an element of a `batchCancelOrders`
                          array, omitted for single `cancelOrder`. Signed over
                          the typed canonical `cancelOrder` payload — identical
                          to the bytes signed for a standalone `cancelOrder`.
                          The shared `timestamp` envelope value is the `ct`
                          field inside the payload.
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - id
            - request
          properties:
            type:
              type: string
              const: post
              x-parser-schema-id: <anonymous-schema-214>
            id:
              type: integer
              example: 43
              x-parser-schema-id: <anonymous-schema-215>
            request:
              allOf:
                - *ref_0
                - type: object
                  required:
                    - type
                    - payload
                  properties:
                    type:
                      type: string
                      const: cancelOrder
                      x-parser-schema-id: <anonymous-schema-218>
                    payload: &ref_3
                      type: object
                      description: >
                        A single cancel. Identical shape to the `cancelOrder`
                        payload and to each element of a `batchCancelOrders`
                        `cancels` array. Provide exactly one of `orderId` or
                        `clientId` (use `kind` to disambiguate when both could
                        apply).
                      required:
                        - address
                        - accountIndex
                        - marketId
                      properties:
                        address:
                          type: string
                          description: >-
                            Master EVM address; must match the API key's master
                            account.
                          example: 0x...
                          x-parser-schema-id: <anonymous-schema-219>
                        accountIndex:
                          type: integer
                          minimum: 0
                          maximum: 9
                          description: Subaccount index (0–9).
                          example: 0
                          x-parser-schema-id: <anonymous-schema-220>
                        marketId:
                          type: integer
                          description: Market enum (e.g. 1 = BTC-USD).
                          example: 0
                          x-parser-schema-id: <anonymous-schema-221>
                        kind:
                          type: string
                          enum:
                            - orderId
                            - clientId
                          description: >-
                            Which identifier to cancel by. Defaults to `orderId`
                            when `orderId` is present.
                          x-parser-schema-id: <anonymous-schema-222>
                        orderId:
                          type: string
                          description: >-
                            System order id. One of `orderId` or `clientId` is
                            required.
                          x-parser-schema-id: <anonymous-schema-223>
                        clientId:
                          type: string
                          description: >-
                            Client-supplied order id from the prior
                            `placeOrder`.
                          x-parser-schema-id: <anonymous-schema-224>
                        validUntil:
                          type: integer
                          format: int64
                          description: >-
                            Optional expiry for the cancel itself (unix
                            seconds).
                          x-parser-schema-id: <anonymous-schema-225>
                        signature:
                          type: string
                          description: >
                            Per-cancel Ed25519 signature (128 hex), REQUIRED
                            when this cancel is an element of a
                            `batchCancelOrders` array, omitted for single
                            `cancelOrder`. Signed over the typed canonical
                            `cancelOrder` payload — identical to the bytes
                            signed for a standalone `cancelOrder`. The shared
                            `timestamp` envelope value is the `ct` field inside
                            the payload.
                          x-parser-schema-id: <anonymous-schema-226>
                      x-parser-schema-id: CancelRequestItem
                  x-parser-schema-id: <anonymous-schema-217>
              x-parser-schema-id: <anonymous-schema-216>
          x-parser-schema-id: CancelOrderPayload
        title: Cancel Order
        example: |-
          {
            "type": "post",
            "id": 43,
            "request": {
              "type": "cancelOrder",
              "payload": {
                "address": "0x...",
                "accountIndex": 0,
                "marketId": 1,
                "orderId": "ord-abc123"
              },
              "apiKey": "<64-hex-public-key>",
              "timestamp": "1712345678000000000",
              "signature": "<128-hex-signature>"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: cancelOrder
      - &ref_9
        id: cancelAllOrders
        contentType: application/json
        payload:
          - name: Cancel All Orders
            description: >
              Cancels every open order for `(address, accountIndex)`. Pass
              `marketId` to scope the cancel to a single market; omit it to
              cancel across all markets. Untriggered TPSL orders in scope are
              canceled too. Mirrors `POST /v1/cancelAllOrders`.
            type: object
            properties:
              - name: type
                type: string
                description: post
                required: true
              - name: id
                type: integer
                required: true
              - name: request
                type: object
                required: true
                properties:
                  - name: apiKey
                    type: string
                    description: Ed25519 public key (64 hex characters).
                    required: true
                  - name: timestamp
                    type: string
                    description: >
                      Unix epoch nanoseconds as a string. Millisecond or second
                      epochs are rejected with `401`; must be within ±30s of
                      server wall-clock.
                    required: true
                  - name: signature
                    type: string
                    description: >
                      Ed25519 signature (128 hex characters). For `placeOrder`,
                      `cancelOrder`, and `modifyOrder` sign the **typed
                      canonical payload** (the JSON object IS the signing
                      message). For legacy methods (`cancelAllOrders`,
                      `setLeverage`) sign `timestamp + action +
                      canonicalJSON(request.payload)` where `action` is the
                      canonical camelCase method name.
                    required: true
                  - name: type
                    type: string
                    description: cancelAllOrders
                    required: true
                  - name: payload
                    type: object
                    required: true
                    properties:
                      - name: address
                        type: string
                        description: >-
                          Master EVM address; must match the API key's master
                          account.
                        required: true
                      - name: accountIndex
                        type: integer
                        description: Subaccount index (0–9).
                        required: true
                      - name: marketId
                        type: integer
                        description: >-
                          Optional market scope. Omit to cancel every open order
                          across all markets on the account.
                        required: false
                      - name: validUntil
                        type: integer
                        description: >-
                          Optional expiry for the cancel-all itself (unix
                          seconds).
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - id
            - request
          properties:
            type:
              type: string
              const: post
              x-parser-schema-id: <anonymous-schema-227>
            id:
              type: integer
              example: 44
              x-parser-schema-id: <anonymous-schema-228>
            request:
              allOf:
                - *ref_0
                - type: object
                  required:
                    - type
                    - payload
                  properties:
                    type:
                      type: string
                      const: cancelAllOrders
                      x-parser-schema-id: <anonymous-schema-231>
                    payload:
                      type: object
                      required:
                        - address
                        - accountIndex
                      properties:
                        address:
                          type: string
                          description: >-
                            Master EVM address; must match the API key's master
                            account.
                          example: 0x...
                          x-parser-schema-id: <anonymous-schema-233>
                        accountIndex:
                          type: integer
                          minimum: 0
                          maximum: 9
                          description: Subaccount index (0–9).
                          example: 0
                          x-parser-schema-id: <anonymous-schema-234>
                        marketId:
                          type: integer
                          description: >-
                            Optional market scope. Omit to cancel every open
                            order across all markets on the account.
                          x-parser-schema-id: <anonymous-schema-235>
                        validUntil:
                          type: integer
                          format: int64
                          description: >-
                            Optional expiry for the cancel-all itself (unix
                            seconds).
                          x-parser-schema-id: <anonymous-schema-236>
                      x-parser-schema-id: <anonymous-schema-232>
                  x-parser-schema-id: <anonymous-schema-230>
              x-parser-schema-id: <anonymous-schema-229>
          x-parser-schema-id: CancelAllOrdersPayload
        title: Cancel All Orders
        description: >
          Cancels every open order for `(address, accountIndex)`. Pass
          `marketId` to scope the cancel to a single market; omit it to cancel
          across all markets. Untriggered TPSL orders in scope are canceled too.
          Mirrors `POST /v1/cancelAllOrders`.
        example: |-
          {
            "type": "post",
            "id": 44,
            "request": {
              "type": "cancelAllOrders",
              "payload": {
                "address": "0x...",
                "accountIndex": 0,
                "marketId": 1
              },
              "apiKey": "<64-hex-public-key>",
              "timestamp": "1712345678000000000",
              "signature": "<128-hex-signature>"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: cancelAllOrders
      - &ref_10
        id: modifyOrder
        contentType: application/json
        payload:
          - name: Modify Order
            type: object
            properties:
              - name: type
                type: string
                description: post
                required: true
              - name: id
                type: integer
                required: true
              - name: request
                type: object
                required: true
                properties:
                  - name: apiKey
                    type: string
                    description: Ed25519 public key (64 hex characters).
                    required: true
                  - name: timestamp
                    type: string
                    description: >
                      Unix epoch nanoseconds as a string. Millisecond or second
                      epochs are rejected with `401`; must be within ±30s of
                      server wall-clock.
                    required: true
                  - name: signature
                    type: string
                    description: >
                      Ed25519 signature (128 hex characters). For `placeOrder`,
                      `cancelOrder`, and `modifyOrder` sign the **typed
                      canonical payload** (the JSON object IS the signing
                      message). For legacy methods (`cancelAllOrders`,
                      `setLeverage`) sign `timestamp + action +
                      canonicalJSON(request.payload)` where `action` is the
                      canonical camelCase method name.
                    required: true
                  - name: type
                    type: string
                    description: modifyOrder
                    required: true
                  - name: payload
                    type: object
                    required: true
                    properties:
                      - name: address
                        type: string
                        description: >-
                          Master EVM address; must match the API key's master
                          account.
                        required: true
                      - name: accountIndex
                        type: integer
                        description: Subaccount index (0–9).
                        required: true
                      - name: marketId
                        type: integer
                        description: Market enum (e.g. 1 = BTC-USD).
                        required: true
                      - name: orderId
                        type: string
                        description: System order id to modify.
                        required: true
                      - name: clientId
                        type: string
                        description: Optional client-supplied order id.
                        required: false
                      - name: side
                        type: string
                        enumValues:
                          - BUY
                          - SELL
                        required: true
                      - name: quantity
                        type: string
                        required: true
                      - name: price
                        type: string
                        required: true
                      - name: timeInForce
                        type: string
                        description: >-
                          GTC = Good Till Canceled, IOC = Immediate or Cancel,
                          FOK = Fill or Kill, ALO = Add Liquidity Only
                          (post-only)
                        enumValues:
                          - GTC
                          - IOC
                          - FOK
                          - ALO
                        required: true
                      - name: reduceOnly
                        type: boolean
                        description: Reduce-only flag.
                        required: false
                      - name: clientTime
                        type: string
                        description: >-
                          Optional client timestamp (unix epoch ms, as a
                          string).
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - id
            - request
          properties:
            type:
              type: string
              const: post
              x-parser-schema-id: <anonymous-schema-237>
            id:
              type: integer
              x-parser-schema-id: <anonymous-schema-238>
            request:
              allOf:
                - *ref_0
                - type: object
                  required:
                    - type
                    - payload
                  properties:
                    type:
                      type: string
                      const: modifyOrder
                      x-parser-schema-id: <anonymous-schema-241>
                    payload:
                      type: object
                      required:
                        - address
                        - accountIndex
                        - marketId
                        - orderId
                        - side
                        - quantity
                        - price
                        - timeInForce
                      properties:
                        address:
                          type: string
                          description: >-
                            Master EVM address; must match the API key's master
                            account.
                          example: 0x...
                          x-parser-schema-id: <anonymous-schema-243>
                        accountIndex:
                          type: integer
                          minimum: 0
                          maximum: 9
                          description: Subaccount index (0–9).
                          example: 0
                          x-parser-schema-id: <anonymous-schema-244>
                        marketId:
                          type: integer
                          description: Market enum (e.g. 1 = BTC-USD).
                          example: 0
                          x-parser-schema-id: <anonymous-schema-245>
                        orderId:
                          type: string
                          description: System order id to modify.
                          x-parser-schema-id: <anonymous-schema-246>
                        clientId:
                          type: string
                          description: Optional client-supplied order id.
                          x-parser-schema-id: <anonymous-schema-247>
                        side:
                          type: string
                          enum:
                            - BUY
                            - SELL
                          x-parser-schema-id: <anonymous-schema-248>
                        quantity:
                          type: string
                          x-parser-schema-id: <anonymous-schema-249>
                        price:
                          type: string
                          x-parser-schema-id: <anonymous-schema-250>
                        timeInForce:
                          type: string
                          enum:
                            - GTC
                            - IOC
                            - FOK
                            - ALO
                          description: >-
                            GTC = Good Till Canceled, IOC = Immediate or Cancel,
                            FOK = Fill or Kill, ALO = Add Liquidity Only
                            (post-only)
                          x-parser-schema-id: <anonymous-schema-251>
                        reduceOnly:
                          type: boolean
                          description: Reduce-only flag.
                          x-parser-schema-id: <anonymous-schema-252>
                        clientTime:
                          type: string
                          description: >-
                            Optional client timestamp (unix epoch ms, as a
                            string).
                          x-parser-schema-id: <anonymous-schema-253>
                      x-parser-schema-id: <anonymous-schema-242>
                  x-parser-schema-id: <anonymous-schema-240>
              x-parser-schema-id: <anonymous-schema-239>
          x-parser-schema-id: ModifyOrderPayload
        title: Modify Order
        example: |-
          {
            "type": "post",
            "id": 5,
            "request": {
              "type": "modifyOrder",
              "payload": {
                "address": "0x...",
                "accountIndex": 0,
                "marketId": 1,
                "orderId": "ord-abc123",
                "side": "BUY",
                "quantity": "0.02",
                "price": "49000",
                "timeInForce": "GTC"
              },
              "apiKey": "<64-hex-public-key>",
              "timestamp": "1712345678000000000",
              "signature": "<128-hex-signature>"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: modifyOrder
      - &ref_11
        id: batchPlaceOrders
        contentType: application/json
        payload:
          - name: Batch Place Orders
            description: >
              Places up to 100 orders in one request. All orders must share the
              same `address` / `accountIndex`. Signed PER ELEMENT using the
              typed canonical payload: each element of `orders` carries its own
              `signature` over the same typed `placeOrder` payload the element
              would carry if submitted standalone (op=1 for regular orders, op=4
              for TPSL legs). The `request` envelope carries only the shared
              `apiKey` + `timestamp`; there is no outer `request.signature`.
              Mirrors `POST /v1/batchPlaceOrders`.
            type: object
            properties:
              - name: type
                type: string
                description: post
                required: true
              - name: id
                type: integer
                required: true
              - name: request
                type: object
                required: true
                properties:
                  - name: apiKey
                    type: string
                    description: Ed25519 public key (64 hex characters).
                    required: true
                  - name: timestamp
                    type: string
                    description: >
                      Unix epoch nanoseconds as a string, shared by every order
                      in the batch. Millisecond or second epochs are rejected
                      with `401`; must be within ±30s of server wall-clock.
                    required: true
                  - name: type
                    type: string
                    description: batchPlaceOrders
                    required: true
                  - name: payload
                    type: object
                    required: true
                    properties:
                      - name: orders
                        type: array
                        description: >
                          Orders to place. All must share the same `address` /
                          `accountIndex`; the server resolves identity from the
                          first entry and overrides `address` on the rest.
                        required: true
                        properties:
                          - name: address
                            type: string
                            description: >-
                              Master EVM address; must match the API key's
                              master account.
                            required: true
                          - name: accountIndex
                            type: integer
                            description: Subaccount index (0–9).
                            required: true
                          - name: marketId
                            type: integer
                            description: Market enum (e.g. 1 = BTC-USD, 2 = ETH-USD).
                            required: true
                          - name: orderSide
                            type: string
                            enumValues:
                              - BUY
                              - SELL
                            required: true
                          - name: orderType
                            type: string
                            description: >
                              Execution style. TPSL trigger orders are still
                              `LIMIT` or `MARKET` here — the trigger semantics
                              come from `tpslType` + `stopPrice`.
                            enumValues:
                              - LIMIT
                              - MARKET
                            required: true
                          - name: timeInForce
                            type: string
                            description: >-
                              GTC = Good Till Canceled, IOC = Immediate or
                              Cancel, FOK = Fill or Kill, ALO = Add Liquidity
                              Only (post-only). Reduce-only non-TPSL orders must
                              be IOC or FOK.
                            enumValues:
                              - GTC
                              - IOC
                              - FOK
                              - ALO
                            required: true
                          - name: quantity
                            type: string
                            description: Order size in base asset, human-readable decimal.
                            required: true
                          - name: price
                            type: string
                            description: >-
                              Human-readable decimal price. Required for `LIMIT`
                              orders (resting limit price) and for **all**
                              `MARKET` orders (protective slippage bound). For
                              plain `MARKET` orders the value must be a positive
                              decimal within **10% of the current mark price**;
                              orders outside this band are rejected with
                              `MarketPriceSlippageToleranceTooHigh`. For TPSL
                              `MARKET` orders the value must be within **10% of
                              `stopPrice`** (trigger price) — at trigger time
                              the mark price ≈ stopPrice, so this enforces the
                              same ±10% slippage protection.
                            required: false
                          - name: clientId
                            type: string
                            description: >-
                              Optional client-supplied order id (idempotency /
                              cancel-by-clientId).
                            required: false
                          - name: clientTime
                            type: string
                            description: >-
                              Optional client timestamp (unix epoch ms, as a
                              string).
                            required: false
                          - name: reduceOnly
                            type: boolean
                            description: >-
                              If true, the order can only reduce an existing
                              position.
                            required: false
                          - name: minSize
                            type: string
                            description: >-
                              Optional minimum fill size, human-readable
                              decimal.
                            required: false
                          - name: stopPrice
                            type: string
                            description: >-
                              Trigger price for TPSL orders, human-readable
                              decimal. Required when `tpslType` is set.
                            required: false
                          - name: tpslType
                            type: string
                            description: >-
                              Marks the order as a take-profit / stop-loss
                              trigger order. Omit for plain orders.
                            enumValues:
                              - STOP_LOSS
                              - TAKE_PROFIT
                            required: false
                          - name: fillMode
                            type: string
                            description: Optional fill-mode hint.
                            required: false
                          - name: signature
                            type: string
                            description: >
                              Per-order Ed25519 signature (128 hex), REQUIRED
                              when this order is an element of a
                              `batchPlaceOrders` array, omitted for single
                              `placeOrder`. Signed over the typed canonical
                              `placeOrder` payload (op=1; op=4 for TPSL legs) —
                              identical to the bytes signed for a standalone
                              `placeOrder`. The shared `timestamp` envelope
                              value is the `ct` field inside the payload.
                            required: false
                      - name: grouping
                        type: string
                        description: >
                          Selects the wire message family. Defaults to `na`
                          (plain orders). Any TPSL grouping requires every order
                          to set `tpslType` + `stopPrice` (except the single
                          entry order in an `entryTpsl` bundle).
                        enumValues:
                          - na
                          - partialTpsl
                          - positionTpsl
                          - entryTpsl
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - id
            - request
          properties:
            type:
              type: string
              const: post
              x-parser-schema-id: <anonymous-schema-254>
            id:
              type: integer
              example: 45
              x-parser-schema-id: <anonymous-schema-255>
            request:
              allOf:
                - &ref_2
                  type: object
                  description: >
                    Envelope signing fields for BATCH order mutations
                    (batchPlaceOrders / batchCancelOrders). Unlike
                    `SignedRequest`, there is NO envelope `signature` — each
                    element of the batch array carries its own per-order
                    `signature` instead. Only the shared `apiKey` + `timestamp`
                    live here.
                  required:
                    - apiKey
                    - timestamp
                  properties:
                    apiKey:
                      type: string
                      description: Ed25519 public key (64 hex characters).
                      example: <64-hex-public-key>
                      x-parser-schema-id: <anonymous-schema-257>
                    timestamp:
                      type: string
                      description: >
                        Unix epoch nanoseconds as a string, shared by every
                        order in the batch. Millisecond or second epochs are
                        rejected with `401`; must be within ±30s of server
                        wall-clock.
                      example: '1712345678000000000'
                      x-parser-schema-id: <anonymous-schema-258>
                  x-parser-schema-id: BatchSignedRequest
                - type: object
                  required:
                    - type
                    - payload
                  properties:
                    type:
                      type: string
                      const: batchPlaceOrders
                      x-parser-schema-id: <anonymous-schema-260>
                    payload:
                      type: object
                      required:
                        - orders
                      properties:
                        orders:
                          type: array
                          minItems: 1
                          maxItems: 100
                          description: >
                            Orders to place. All must share the same `address` /
                            `accountIndex`; the server resolves identity from
                            the first entry and overrides `address` on the rest.
                          items: *ref_1
                          x-parser-schema-id: <anonymous-schema-262>
                        grouping:
                          type: string
                          enum:
                            - na
                            - partialTpsl
                            - positionTpsl
                            - entryTpsl
                          description: >
                            Selects the wire message family. Defaults to `na`
                            (plain orders). Any TPSL grouping requires every
                            order to set `tpslType` + `stopPrice` (except the
                            single entry order in an `entryTpsl` bundle).
                          x-parser-schema-id: <anonymous-schema-263>
                      x-parser-schema-id: <anonymous-schema-261>
                  x-parser-schema-id: <anonymous-schema-259>
              x-parser-schema-id: <anonymous-schema-256>
          x-parser-schema-id: BatchPlaceOrdersPayload
        title: Batch Place Orders
        description: >
          Places up to 100 orders in one request. All orders must share the same
          `address` / `accountIndex`. Signed PER ELEMENT using the typed
          canonical payload: each element of `orders` carries its own
          `signature` over the same typed `placeOrder` payload the element would
          carry if submitted standalone (op=1 for regular orders, op=4 for TPSL
          legs). The `request` envelope carries only the shared `apiKey` +
          `timestamp`; there is no outer `request.signature`. Mirrors `POST
          /v1/batchPlaceOrders`.
        example: |-
          {
            "type": "post",
            "id": 45,
            "request": {
              "type": "batchPlaceOrders",
              "payload": {
                "orders": [
                  {
                    "address": "0x...",
                    "accountIndex": 0,
                    "marketId": 1,
                    "orderSide": "BUY",
                    "orderType": "LIMIT",
                    "timeInForce": "GTC",
                    "quantity": "0.1",
                    "price": "49000",
                    "clientId": "bid-1",
                    "signature": "<128-hex signature for this order>"
                  },
                  {
                    "address": "0x...",
                    "accountIndex": 0,
                    "marketId": 1,
                    "orderSide": "SELL",
                    "orderType": "LIMIT",
                    "timeInForce": "GTC",
                    "quantity": "0.1",
                    "price": "51000",
                    "clientId": "ask-1",
                    "signature": "<128-hex signature for this order>"
                  }
                ]
              },
              "apiKey": "<64-hex-public-key>",
              "timestamp": "1712345678000000000"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: batchPlaceOrders
      - &ref_12
        id: batchCancelOrders
        contentType: application/json
        payload:
          - name: Batch Cancel Orders
            description: >
              Cancels up to 100 orders in one request. All cancels must share
              the same `address` / `accountIndex`. Signed PER ELEMENT using the
              typed canonical payload: each element of `cancels` carries its own
              `signature` over the same typed `cancelOrder` payload the element
              would carry if submitted standalone. The `request` envelope
              carries only the shared `apiKey` + `timestamp`; there is no outer
              `request.signature`. Mirrors `POST /v1/batchCancelOrders`.
            type: object
            properties:
              - name: type
                type: string
                description: post
                required: true
              - name: id
                type: integer
                required: true
              - name: request
                type: object
                required: true
                properties:
                  - name: apiKey
                    type: string
                    description: Ed25519 public key (64 hex characters).
                    required: true
                  - name: timestamp
                    type: string
                    description: >
                      Unix epoch nanoseconds as a string, shared by every order
                      in the batch. Millisecond or second epochs are rejected
                      with `401`; must be within ±30s of server wall-clock.
                    required: true
                  - name: type
                    type: string
                    description: batchCancelOrders
                    required: true
                  - name: payload
                    type: object
                    required: true
                    properties:
                      - name: cancels
                        type: array
                        description: >
                          Cancels to submit. All must share the same `address` /
                          `accountIndex`; the server resolves identity from the
                          first entry.
                        required: true
                        properties:
                          - name: address
                            type: string
                            description: >-
                              Master EVM address; must match the API key's
                              master account.
                            required: true
                          - name: accountIndex
                            type: integer
                            description: Subaccount index (0–9).
                            required: true
                          - name: marketId
                            type: integer
                            description: Market enum (e.g. 1 = BTC-USD).
                            required: true
                          - name: kind
                            type: string
                            description: >-
                              Which identifier to cancel by. Defaults to
                              `orderId` when `orderId` is present.
                            enumValues:
                              - orderId
                              - clientId
                            required: false
                          - name: orderId
                            type: string
                            description: >-
                              System order id. One of `orderId` or `clientId` is
                              required.
                            required: false
                          - name: clientId
                            type: string
                            description: >-
                              Client-supplied order id from the prior
                              `placeOrder`.
                            required: false
                          - name: validUntil
                            type: integer
                            description: >-
                              Optional expiry for the cancel itself (unix
                              seconds).
                            required: false
                          - name: signature
                            type: string
                            description: >
                              Per-cancel Ed25519 signature (128 hex), REQUIRED
                              when this cancel is an element of a
                              `batchCancelOrders` array, omitted for single
                              `cancelOrder`. Signed over the typed canonical
                              `cancelOrder` payload — identical to the bytes
                              signed for a standalone `cancelOrder`. The shared
                              `timestamp` envelope value is the `ct` field
                              inside the payload.
                            required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - id
            - request
          properties:
            type:
              type: string
              const: post
              x-parser-schema-id: <anonymous-schema-264>
            id:
              type: integer
              example: 46
              x-parser-schema-id: <anonymous-schema-265>
            request:
              allOf:
                - *ref_2
                - type: object
                  required:
                    - type
                    - payload
                  properties:
                    type:
                      type: string
                      const: batchCancelOrders
                      x-parser-schema-id: <anonymous-schema-268>
                    payload:
                      type: object
                      required:
                        - cancels
                      properties:
                        cancels:
                          type: array
                          minItems: 1
                          maxItems: 100
                          description: >
                            Cancels to submit. All must share the same `address`
                            / `accountIndex`; the server resolves identity from
                            the first entry.
                          items: *ref_3
                          x-parser-schema-id: <anonymous-schema-270>
                      x-parser-schema-id: <anonymous-schema-269>
                  x-parser-schema-id: <anonymous-schema-267>
              x-parser-schema-id: <anonymous-schema-266>
          x-parser-schema-id: BatchCancelOrdersPayload
        title: Batch Cancel Orders
        description: >
          Cancels up to 100 orders in one request. All cancels must share the
          same `address` / `accountIndex`. Signed PER ELEMENT using the typed
          canonical payload: each element of `cancels` carries its own
          `signature` over the same typed `cancelOrder` payload the element
          would carry if submitted standalone. The `request` envelope carries
          only the shared `apiKey` + `timestamp`; there is no outer
          `request.signature`. Mirrors `POST /v1/batchCancelOrders`.
        example: |-
          {
            "type": "post",
            "id": 46,
            "request": {
              "type": "batchCancelOrders",
              "payload": {
                "cancels": [
                  {
                    "address": "0x...",
                    "accountIndex": 0,
                    "marketId": 1,
                    "orderId": "ord-abc123",
                    "signature": "<128-hex signature for this cancel>"
                  },
                  {
                    "address": "0x...",
                    "accountIndex": 0,
                    "marketId": 1,
                    "clientId": "bid-1",
                    "signature": "<128-hex signature for this cancel>"
                  }
                ]
              },
              "apiKey": "<64-hex-public-key>",
              "timestamp": "1712345678000000000"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: batchCancelOrders
      - &ref_13
        id: setLeverage
        contentType: application/json
        payload:
          - name: Set Leverage
            description: >
              Per-`(account, market)` leverage. Mirrors `POST /v1/setLeverage`.
              `leverage` is an integer in `[1, market max]`; values outside this
              range are rejected with `400`. The WS path returns immediately on
              Kafka accept (envelope `status: 202`, body `status: ACK`);
              subscribe to the `accountAttributes` channel to observe the
              engine-confirmed `APPLIED` / `REJECTED` lifecycle.
            type: object
            properties:
              - name: type
                type: string
                description: post
                required: true
              - name: id
                type: integer
                required: true
              - name: request
                type: object
                required: true
                properties:
                  - name: apiKey
                    type: string
                    description: Ed25519 public key (64 hex characters).
                    required: true
                  - name: timestamp
                    type: string
                    description: >
                      Unix epoch nanoseconds as a string. Millisecond or second
                      epochs are rejected with `401`; must be within ±30s of
                      server wall-clock.
                    required: true
                  - name: signature
                    type: string
                    description: >
                      Ed25519 signature (128 hex characters). For `placeOrder`,
                      `cancelOrder`, and `modifyOrder` sign the **typed
                      canonical payload** (the JSON object IS the signing
                      message). For legacy methods (`cancelAllOrders`,
                      `setLeverage`) sign `timestamp + action +
                      canonicalJSON(request.payload)` where `action` is the
                      canonical camelCase method name.
                    required: true
                  - name: type
                    type: string
                    description: setLeverage
                    required: true
                  - name: payload
                    type: object
                    required: true
                    properties:
                      - name: address
                        type: string
                        description: Master Ethereum address (0x-prefixed, 40 hex digits).
                        required: true
                      - name: accountIndex
                        type: integer
                        description: Subaccount index (0–9).
                        required: true
                      - name: marketId
                        type: integer
                        required: true
                      - name: leverage
                        type: integer
                        description: Leverage to set. Must be in `[1, market max]`.
                        required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - id
            - request
          properties:
            type:
              type: string
              const: post
              x-parser-schema-id: <anonymous-schema-271>
            id:
              type: integer
              x-parser-schema-id: <anonymous-schema-272>
            request:
              allOf:
                - *ref_0
                - type: object
                  required:
                    - type
                    - payload
                  properties:
                    type:
                      type: string
                      const: setLeverage
                      x-parser-schema-id: <anonymous-schema-275>
                    payload:
                      type: object
                      required:
                        - address
                        - accountIndex
                        - marketId
                        - leverage
                      properties:
                        address:
                          type: string
                          description: >-
                            Master Ethereum address (0x-prefixed, 40 hex
                            digits).
                          x-parser-schema-id: <anonymous-schema-277>
                        accountIndex:
                          type: integer
                          minimum: 0
                          maximum: 9
                          description: Subaccount index (0–9).
                          x-parser-schema-id: <anonymous-schema-278>
                        marketId:
                          type: integer
                          x-parser-schema-id: <anonymous-schema-279>
                        leverage:
                          type: integer
                          minimum: 1
                          maximum: 1000
                          description: Leverage to set. Must be in `[1, market max]`.
                          x-parser-schema-id: <anonymous-schema-280>
                      x-parser-schema-id: <anonymous-schema-276>
                  x-parser-schema-id: <anonymous-schema-274>
              x-parser-schema-id: <anonymous-schema-273>
          x-parser-schema-id: SetLeveragePayload
        title: Set Leverage
        description: >
          Per-`(account, market)` leverage. Mirrors `POST /v1/setLeverage`.
          `leverage` is an integer in `[1, market max]`; values outside this
          range are rejected with `400`. The WS path returns immediately on
          Kafka accept (envelope `status: 202`, body `status: ACK`); subscribe
          to the `accountAttributes` channel to observe the engine-confirmed
          `APPLIED` / `REJECTED` lifecycle.
        example: |-
          {
            "type": "post",
            "id": 7,
            "request": {
              "type": "setLeverage",
              "payload": {
                "address": "0x...",
                "accountIndex": 0,
                "marketId": 1,
                "leverage": 5
              },
              "apiKey": "<64-hex-public-key>",
              "timestamp": "1712345678000000000",
              "signature": "<128-hex-signature>"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: setLeverage
      - &ref_14
        id: getSnapshot
        contentType: application/json
        payload:
          - name: Get Snapshot (RPC)
            type: object
            properties:
              - name: type
                type: string
                description: get
                required: true
              - name: id
                type: integer
                description: Client-chosen request id, echoed in the response.
                required: true
              - name: request
                type: object
                required: true
                properties:
                  - name: type
                    type: string
                    description: RPC method name.
                    enumValues:
                      - l2orderbook
                      - bbo
                      - mids
                      - account
                      - fills
                      - orders
                      - markets
                      - prices
                      - positions
                      - ratelimit
                    required: true
                  - name: payload
                    type: object
                    description: >-
                      Method-specific parameters. `market` required for
                      market-scoped RPCs.
                    required: false
                    properties: []
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - id
            - request
          properties:
            type:
              type: string
              const: get
              x-parser-schema-id: <anonymous-schema-281>
            id:
              type: integer
              description: Client-chosen request id, echoed in the response.
              example: 2
              x-parser-schema-id: <anonymous-schema-282>
            request:
              type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - l2orderbook
                    - bbo
                    - mids
                    - account
                    - fills
                    - orders
                    - markets
                    - prices
                    - positions
                    - ratelimit
                  description: RPC method name.
                  x-parser-schema-id: <anonymous-schema-284>
                payload:
                  type: object
                  additionalProperties: true
                  description: >-
                    Method-specific parameters. `market` required for
                    market-scoped RPCs.
                  example:
                    market: BTC-USD
                  properties: {}
                  x-parser-schema-id: <anonymous-schema-285>
              x-parser-schema-id: <anonymous-schema-283>
          x-parser-schema-id: GetRequestPayload
        title: Get Snapshot (RPC)
        example: |-
          {
            "type": "get",
            "id": 2,
            "request": {
              "type": "l2orderbook",
              "payload": {
                "market": "BTC-USD"
              }
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: getSnapshot
    bindings: []
    extensions: &ref_4
      - id: x-parser-unique-object-id
        value: orderOperations
  - &ref_6
    id: receiveOrderOperationResponse
    title: Receive order operation response
    type: send
    messages:
      - &ref_15
        id: response
        contentType: application/json
        payload:
          - name: RPC Response
            description: >
              Response to a `post` or `get` request. `id` is always echoed from
              the request. Order mutations reply with `status: 202` (accepted,
              not terminal). Other methods reply with `status: 200` on success.
            type: object
            properties:
              - name: method
                type: string
                description: Echoed from `request.type`.
                required: true
              - name: id
                type: integer
                description: Echoed from the request `id`.
                required: true
              - name: status
                type: integer
                description: >
                  HTTP-like status. 200 = success with a definitive engine ack,
                  202 = accepted (not terminal — observe `orders`/`userFills`
                  for the lifecycle), 4xx = client error, 5xx = gateway error.
                enumValues:
                  - 200
                  - 202
                  - 400
                  - 401
                  - 403
                  - 404
                  - 409
                  - 429
                  - 500
                  - 501
                  - 503
                required: true
              - name: result
                type: object
                description: Present on success.
                required: false
                properties: []
              - name: error
                type: object
                description: Present on failure.
                required: false
                properties:
                  - name: type
                    type: string
                    required: false
                  - name: message
                    type: string
                    required: false
                  - name: field
                    type: string
                    description: Field that caused the error, if applicable.
                    required: false
                  - name: errorType
                    type: string
                    description: Machine-readable error code.
                    required: false
                  - name: errorSource
                    type: string
                    description: Which layer surfaced the error.
                    required: false
                  - name: retryAfterMs
                    type: integer
                    description: >
                      Present only on 429 (rate-limit) errors. Precise
                      milliseconds the client should wait before retrying.
                      Mirrors the REST 429 body's `retryAfterMs` field.
                      Allowlisted addresses (server-side
                      `RATELIMIT_BYPASS_ADDRESSES`) skip the rate-limit layer
                      entirely and never see this field.
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - method
            - id
            - status
          properties:
            method:
              type: string
              description: Echoed from `request.type`.
              x-parser-schema-id: <anonymous-schema-286>
            id:
              type: integer
              description: Echoed from the request `id`.
              x-parser-schema-id: <anonymous-schema-287>
            status:
              type: integer
              description: >
                HTTP-like status. 200 = success with a definitive engine ack,
                202 = accepted (not terminal — observe `orders`/`userFills` for
                the lifecycle), 4xx = client error, 5xx = gateway error.
              enum:
                - 200
                - 202
                - 400
                - 401
                - 403
                - 404
                - 409
                - 429
                - 500
                - 501
                - 503
              x-parser-schema-id: <anonymous-schema-288>
            result:
              type: object
              additionalProperties: true
              description: Present on success.
              properties: {}
              x-parser-schema-id: <anonymous-schema-289>
            error:
              type: object
              description: Present on failure.
              properties:
                type:
                  type: string
                  x-parser-schema-id: <anonymous-schema-291>
                message:
                  type: string
                  x-parser-schema-id: <anonymous-schema-292>
                field:
                  type: string
                  description: Field that caused the error, if applicable.
                  x-parser-schema-id: <anonymous-schema-293>
                errorType:
                  type: string
                  description: Machine-readable error code.
                  x-parser-schema-id: <anonymous-schema-294>
                errorSource:
                  type: string
                  description: Which layer surfaced the error.
                  x-parser-schema-id: <anonymous-schema-295>
                retryAfterMs:
                  type: integer
                  format: int64
                  minimum: 0
                  description: >
                    Present only on 429 (rate-limit) errors. Precise
                    milliseconds the client should wait before retrying. Mirrors
                    the REST 429 body's `retryAfterMs` field. Allowlisted
                    addresses (server-side `RATELIMIT_BYPASS_ADDRESSES`) skip
                    the rate-limit layer entirely and never see this field.
                  x-parser-schema-id: <anonymous-schema-296>
              x-parser-schema-id: <anonymous-schema-290>
          x-parser-schema-id: RpcResponsePayload
        title: RPC Response
        description: >
          Response to a `post` or `get` request. `id` is always echoed from the
          request. Order mutations reply with `status: 202` (accepted, not
          terminal). Other methods reply with `status: 200` on success.
        example: |-
          {
            "method": "placeOrder",
            "id": 1,
            "status": 202,
            "result": {
              "orderId": "ord-abc123",
              "status": "ACK"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: response
    bindings: []
    extensions: *ref_4
sendOperations:
  - *ref_5
receiveOperations:
  - *ref_6
sendMessages:
  - *ref_7
  - *ref_8
  - *ref_9
  - *ref_10
  - *ref_11
  - *ref_12
  - *ref_13
  - *ref_14
receiveMessages:
  - *ref_15
extensions:
  - id: x-parser-unique-object-id
    value: orderOperations
securitySchemes: []

````