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

# Recent Orders Stream

> Recent order history.

This stream is available on the `optionsRecentOrders` subscription. It provides your recent order history.

#### Snapshot vs. Delta

The `emitOptionsRecentOrders` request returns a snapshot via `optionsRecentOrders`. Once subscribed, `optionsRecentOrdersDelta` messages carry new or updated history entries in the same shape.


## AsyncAPI

````yaml latest/options/asyncapi/options-ws.yaml recentOrdersStream
id: recentOrdersStream
title: Recent Orders Stream
description: >-
  Available on the `optionsRecentOrders` subscription. Your recent order
  history.
servers:
  - id: sandbox
    protocol: wss
    host: ws.sandbox.rails.xyz
    bindings: []
    variables: []
address: >-
  ?product=options&market={market}&expiration={expiration}&strike={strike}&type={type}&subscriptions=optionsRecentOrders
parameters:
  - id: market
    jsonSchema:
      type: string
      description: A specific market (e.g. `BTC-USDT`) or `ALL`.
      default: BTC-USDT
    description: A specific market (e.g. `BTC-USDT`) or `ALL`.
    type: string
    required: true
    deprecated: false
  - id: expiration
    jsonSchema:
      type: string
      description: >-
        Contract expiration, e.g. `24JUN26`. Requires `market`; omit to match
        every expiration.
      default: 24JUN26
    description: >-
      Contract expiration, e.g. `24JUN26`. Requires `market`; omit to match
      every expiration.
    type: string
    required: true
    deprecated: false
  - id: strike
    jsonSchema:
      type: string
      description: >-
        Strike price, e.g. `62000`. Requires `expiration`; omit to match every
        strike.
      default: '62000'
    description: >-
      Strike price, e.g. `62000`. Requires `expiration`; omit to match every
      strike.
    type: string
    required: true
    deprecated: false
  - id: type
    jsonSchema:
      type: string
      description: '`C` (call) or `P` (put). Requires `strike`; omit to match both.'
      default: C
    description: '`C` (call) or `P` (put). Requires `strike`; omit to match both.'
    type: string
    required: true
    deprecated: false
bindings: []
operations:
  - &ref_2
    id: emitOptionsRecentOrders
    title: Emit options recent orders
    description: Request a snapshot of your recent order history.
    type: receive
    messages:
      - &ref_5
        id: emitOptionsRecentOrdersRequest
        contentType: application/json
        payload:
          - name: Emit Options Recent Orders
            type: object
            properties:
              - name: message
                type: string
                description: Always `emitOptionsRecentOrders`.
                required: true
              - name: content
                type: object
                required: false
                properties:
                  - name: clientRequestId
                    type: string
                    description: Client-generated UUID for correlation
                    required: false
                  - name: market
                    type: string
                    description: A contract name to filter, or `ALL` for every market
                    required: false
                  - name: limit
                    type: integer
                    description: Maximum number of orders to return
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            message:
              type: string
              description: Always `emitOptionsRecentOrders`.
              x-parser-schema-id: <anonymous-schema-440>
            content:
              type: object
              properties:
                clientRequestId:
                  type: string
                  format: uuid
                  description: Client-generated UUID for correlation
                  x-parser-schema-id: <anonymous-schema-442>
                market:
                  type: string
                  description: A contract name to filter, or `ALL` for every market
                  x-parser-schema-id: <anonymous-schema-443>
                limit:
                  type: integer
                  description: Maximum number of orders to return
                  x-parser-schema-id: <anonymous-schema-444>
              x-parser-schema-id: <anonymous-schema-441>
          required:
            - message
          x-parser-schema-id: <anonymous-schema-439>
        title: Emit Options Recent Orders
        example: |-
          {
            "message": "emitOptionsRecentOrders",
            "content": {
              "clientRequestId": "f35fd4a3-749c-4562-bfe6-5b896b887b59",
              "market": "BTC-10JUL26-55000-C",
              "limit": 100
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: emitOptionsRecentOrdersRequest
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: recentOrdersStream
  - &ref_3
    id: optionsRecentOrdersSnapshot
    title: Options recent orders snapshot
    description: Response to `emitOptionsRecentOrders`.
    type: send
    messages:
      - &ref_6
        id: optionsRecentOrdersResponse
        contentType: application/json
        payload:
          - name: Recent Orders Snapshot
            description: Response to `emitOptionsRecentOrders`.
            type: object
            properties:
              - name: resultType
                type: string
                description: Always `optionsRecentOrders`.
                required: true
              - name: market
                type: string
                description: Contract name, or `ALL`
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: orders
                    type: array
                    description: Your recent order history
                    required: true
                    properties:
                      - name: orderId
                        type: string
                        description: Order identifier
                        required: true
                      - name: contract
                        type: string
                        description: Contract name
                        required: true
                      - name: side
                        type: string
                        description: Order side
                        enumValues:
                          - buy
                          - sell
                        required: true
                      - name: type
                        type: string
                        description: Order type
                        enumValues:
                          - limit
                          - market
                        required: true
                      - name: fillType
                        type: string
                        description: >
                          How much of the order filled — `complete` when
                          `filledQuantity` reached `quantity`, `partial` when it
                          stopped short. Absent on cancelled orders, which are
                          cancelled by definition
                        enumValues:
                          - complete
                          - partial
                        required: false
                      - name: price
                        type: string
                        description: >-
                          The price the user submitted — the limit price for
                          limit orders, or the requested price for market orders
                        required: true
                      - name: quantity
                        type: string
                        description: Order quantity
                        required: true
                      - name: filledQuantity
                        type: string
                        description: Quantity filled
                        required: true
                      - name: avgFillPrice
                        type: string
                        description: >-
                          Volume-weighted average fill price; `0` while nothing
                          has filled
                        required: true
                      - name: leverage
                        type: string
                        description: Leverage — always `0` for options
                        required: true
                      - name: createdAt
                        type: integer
                        description: Creation time (ms since epoch)
                        required: true
                      - name: updatedAt
                        type: integer
                        description: Last update time (ms since epoch)
                        required: true
                  - name: statusCode
                    type: integer
                    description: Always `200`.
                    required: true
                  - name: clientRequestId
                    type: string
                    description: Client-generated UUID for correlation
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            resultType:
              type: string
              description: Always `optionsRecentOrders`.
              x-parser-schema-id: <anonymous-schema-446>
            market:
              type: string
              description: Contract name, or `ALL`
              x-parser-schema-id: <anonymous-schema-447>
            data:
              type: object
              properties:
                orders:
                  type: array
                  description: Your recent order history
                  items: &ref_1
                    type: object
                    properties:
                      orderId:
                        type: string
                        description: Order identifier
                        x-parser-schema-id: <anonymous-schema-450>
                      contract:
                        type: string
                        description: Contract name
                        x-parser-schema-id: <anonymous-schema-451>
                      side:
                        type: string
                        enum:
                          - buy
                          - sell
                        description: Order side
                        x-parser-schema-id: <anonymous-schema-452>
                      type:
                        type: string
                        enum:
                          - limit
                          - market
                        description: Order type
                        x-parser-schema-id: <anonymous-schema-453>
                      fillType:
                        type: string
                        enum:
                          - complete
                          - partial
                        description: >
                          How much of the order filled — `complete` when
                          `filledQuantity` reached `quantity`, `partial` when it
                          stopped short. Absent on cancelled orders, which are
                          cancelled by definition
                        x-parser-schema-id: <anonymous-schema-454>
                      price:
                        type: string
                        description: >-
                          The price the user submitted — the limit price for
                          limit orders, or the requested price for market orders
                        x-parser-schema-id: <anonymous-schema-455>
                      quantity:
                        type: string
                        description: Order quantity
                        x-parser-schema-id: <anonymous-schema-456>
                      filledQuantity:
                        type: string
                        description: Quantity filled
                        x-parser-schema-id: <anonymous-schema-457>
                      avgFillPrice:
                        type: string
                        description: >-
                          Volume-weighted average fill price; `0` while nothing
                          has filled
                        x-parser-schema-id: <anonymous-schema-458>
                      leverage:
                        type: string
                        description: Leverage — always `0` for options
                        x-parser-schema-id: <anonymous-schema-459>
                      createdAt:
                        type: integer
                        description: Creation time (ms since epoch)
                        x-parser-schema-id: <anonymous-schema-460>
                      updatedAt:
                        type: integer
                        description: Last update time (ms since epoch)
                        x-parser-schema-id: <anonymous-schema-461>
                    required:
                      - orderId
                      - contract
                      - side
                      - type
                      - price
                      - quantity
                      - filledQuantity
                      - avgFillPrice
                      - leverage
                      - createdAt
                      - updatedAt
                    x-parser-schema-id: RecentOrder
                  x-parser-schema-id: <anonymous-schema-449>
                statusCode:
                  type: integer
                  description: Always `200`.
                  x-parser-schema-id: <anonymous-schema-462>
                clientRequestId:
                  type: string
                  description: Client-generated UUID for correlation
                  x-parser-schema-id: <anonymous-schema-463>
              required:
                - orders
                - statusCode
              x-parser-schema-id: <anonymous-schema-448>
          required:
            - resultType
            - market
            - data
          x-parser-schema-id: <anonymous-schema-445>
        title: Recent Orders Snapshot
        description: Response to `emitOptionsRecentOrders`.
        example: |-
          {
            "resultType": "optionsRecentOrders",
            "market": "BTC-10JUL26-55000-C",
            "data": {
              "orders": [
                {
                  "orderId": "01KWKXFHQJTQMNWPT1Y8X54HJP",
                  "contract": "BTC-10JUL26-55000-C",
                  "side": "buy",
                  "type": "market",
                  "fillType": "complete",
                  "price": "7000",
                  "quantity": "1",
                  "filledQuantity": "1",
                  "avgFillPrice": "6948.86",
                  "leverage": "0",
                  "createdAt": 1783079880436,
                  "updatedAt": 1783079880436
                }
              ],
              "statusCode": 200,
              "clientRequestId": "f35fd4a3-749c-4562-bfe6-5b896b887b59"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: optionsRecentOrdersResponse
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: optionsRecentOrdersUpdate
    title: Options recent orders update
    description: Pushed whenever your recent order history changes.
    type: send
    messages:
      - &ref_7
        id: optionsRecentOrdersDelta
        contentType: application/json
        payload:
          - name: Recent Order Delta
            description: >-
              Pushed with new or updated history entries, in the same shape as
              the snapshot.
            type: object
            properties:
              - name: resultType
                type: string
                description: Always `optionsRecentOrdersDelta`.
                required: true
              - name: market
                type: string
                description: Contract name
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: orders
                    type: array
                    description: New or updated history entries
                    required: true
                    properties:
                      - name: orderId
                        type: string
                        description: Order identifier
                        required: true
                      - name: contract
                        type: string
                        description: Contract name
                        required: true
                      - name: side
                        type: string
                        description: Order side
                        enumValues:
                          - buy
                          - sell
                        required: true
                      - name: type
                        type: string
                        description: Order type
                        enumValues:
                          - limit
                          - market
                        required: true
                      - name: fillType
                        type: string
                        description: >
                          How much of the order filled — `complete` when
                          `filledQuantity` reached `quantity`, `partial` when it
                          stopped short. Absent on cancelled orders, which are
                          cancelled by definition
                        enumValues:
                          - complete
                          - partial
                        required: false
                      - name: price
                        type: string
                        description: >-
                          The price the user submitted — the limit price for
                          limit orders, or the requested price for market orders
                        required: true
                      - name: quantity
                        type: string
                        description: Order quantity
                        required: true
                      - name: filledQuantity
                        type: string
                        description: Quantity filled
                        required: true
                      - name: avgFillPrice
                        type: string
                        description: >-
                          Volume-weighted average fill price; `0` while nothing
                          has filled
                        required: true
                      - name: leverage
                        type: string
                        description: Leverage — always `0` for options
                        required: true
                      - name: createdAt
                        type: integer
                        description: Creation time (ms since epoch)
                        required: true
                      - name: updatedAt
                        type: integer
                        description: Last update time (ms since epoch)
                        required: true
                  - name: statusCode
                    type: integer
                    description: Always `200`.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            resultType:
              type: string
              description: Always `optionsRecentOrdersDelta`.
              x-parser-schema-id: <anonymous-schema-465>
            market:
              type: string
              description: Contract name
              x-parser-schema-id: <anonymous-schema-466>
            data:
              type: object
              properties:
                orders:
                  type: array
                  description: New or updated history entries
                  items: *ref_1
                  x-parser-schema-id: <anonymous-schema-468>
                statusCode:
                  type: integer
                  description: Always `200`.
                  x-parser-schema-id: <anonymous-schema-469>
              required:
                - orders
                - statusCode
              x-parser-schema-id: <anonymous-schema-467>
          required:
            - resultType
            - market
            - data
          x-parser-schema-id: <anonymous-schema-464>
        title: Recent Order Delta
        description: >-
          Pushed with new or updated history entries, in the same shape as the
          snapshot.
        example: |-
          {
            "resultType": "optionsRecentOrdersDelta",
            "market": "BTC-10JUL26-55000-C",
            "data": {
              "orders": [
                {
                  "orderId": "01KWKXFHQJTQMNWPT1Y8X54HJP",
                  "contract": "BTC-10JUL26-55000-C",
                  "side": "buy",
                  "type": "market",
                  "fillType": "complete",
                  "price": "7000",
                  "quantity": "1",
                  "filledQuantity": "1",
                  "avgFillPrice": "6948.86",
                  "leverage": "0",
                  "createdAt": 1783079880436,
                  "updatedAt": 1783079880436
                }
              ],
              "statusCode": 200
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: optionsRecentOrdersDelta
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_2
receiveOperations:
  - *ref_3
  - *ref_4
sendMessages:
  - *ref_5
receiveMessages:
  - *ref_6
  - *ref_7
extensions:
  - id: x-parser-unique-object-id
    value: recentOrdersStream
securitySchemes:
  - id: wsAuth
    name: Sec-WebSocket-Protocol
    type: httpApiKey
    description: Supply as `authorization#<JWT>` during the WebSocket handshake.
    in: header
    extensions: []

````