> ## 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

This stream provides your recent order history. Subscribe with the `optionsRecentOrders`
subscription, then request a snapshot with `emitOptionsRecentOrders`. Subsequent changes
arrive as `optionsRecentOrdersDelta` messages.

### Recent Orders Snapshot Request

#### Request

```json theme={null}
{
  "message": "emitOptionsRecentOrders",
  "content": {
    "clientRequestId": "f35fd4a3-749c-4562-bfe6-5b896b887b59",
    "market": "BTC-10JUL26-55000-C",
    "limit": 100
  }
}
```

| Field                     | Type   | Required | Description                                          |
| ------------------------- | ------ | -------- | ---------------------------------------------------- |
| `message`                 | string | Yes      | `emitOptionsRecentOrders`                            |
| `content.clientRequestId` | string | No       | Client-generated UUID for correlation                |
| `content.market`          | string | No       | A contract name to filter, or `ALL` for every market |
| `content.limit`           | number | No       | Maximum number of orders to return                   |

#### Response

```json theme={null}
{
  "resultType": "optionsRecentOrders",
  "market": "BTC-10JUL26-55000-C",
  "data": {
    "orders": [
      {
        "orderId": "01KWKXFHQJTQMNWPT1Y8X54HJP",
        "market": "BTC-10JUL26-55000-C",
        "side": "buy",
        "type": "market",
        "status": "completed",
        "price": "6948.86",
        "quantity": "1",
        "filledQuantity": "1",
        "leverage": "0",
        "createdAt": 1783079880436,
        "updatedAt": 1783079880436
      }
    ],
    "statusCode": 200,
    "clientRequestId": "f35fd4a3-749c-4562-bfe6-5b896b887b59"
  }
}
```

| Field                                   | Type   | Required | Description                                             |
| --------------------------------------- | ------ | -------- | ------------------------------------------------------- |
| `resultType`                            | string | Yes      | `optionsRecentOrders`                                   |
| `market`                                | string | Yes      | Contract name                                           |
| `data.orders[].orderId`                 | string | Yes      | Order identifier                                        |
| `data.orders[].market`                  | string | Yes      | Contract name                                           |
| `data.orders[].side`                    | string | Yes      | `buy` or `sell`                                         |
| `data.orders[].type`                    | string | Yes      | Order type: `limit` or `market`                         |
| `data.orders[].status`                  | string | Yes      | Order status, e.g. `completed`, `cancelled`, `rejected` |
| `data.orders[].price`                   | string | Yes      | Order price                                             |
| `data.orders[].quantity`                | string | Yes      | Order quantity                                          |
| `data.orders[].filledQuantity`          | string | Yes      | Quantity filled                                         |
| `data.orders[].leverage`                | string | Yes      | Leverage — always `0` for options                       |
| `data.orders[].createdAt` / `updatedAt` | number | Yes      | Timestamps (ms since epoch)                             |
| `data.statusCode`                       | number | Yes      | `200`                                                   |
| `data.clientRequestId`                  | string | No       | Client-generated UUID for correlation                   |

### Recent Order Updates

`optionsRecentOrdersDelta` messages carry new or updated history entries in the same shape
under `data.orders`.
