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

# Positions Stream

This stream provides your open option positions with mark price, margin, and PnL. Subscribe
with the `optionsPositions` subscription, then request a snapshot with `emitOptionsPositions`.
Changes arrive as `optionsPositionsDelta` messages.

### Positions Snapshot Request

#### Request

```json theme={null}
{
  "message": "emitOptionsPositions",
  "content": {
    "clientRequestId": "b8c56794-c7f8-467d-b331-be8c765a5378",
    "market": "BTC-10JUL26-55000-C"
  }
}
```

| Field                     | Type   | Required | Description                                            |
| ------------------------- | ------ | -------- | ------------------------------------------------------ |
| `message`                 | string | Yes      | `emitOptionsPositions`                                 |
| `content.clientRequestId` | string | No       | Client-generated UUID for correlation                  |
| `content.market`          | string | No       | A contract name to filter, or `ALL` for every position |
| `content.pageSize`        | number | No       | Page size for paginated results                        |
| `content.pageToken`       | string | No       | Cursor for the next page                               |

#### Response

```json theme={null}
{
  "resultType": "optionsPositions",
  "market": "BTC-10JUL26-55000-C",
  "data": {
    "positions": [
      {
        "market": "BTC-10JUL26-55000-C",
        "side": "long",
        "optionType": "call",
        "qty": "1",
        "value": "6948.86",
        "entryPrice": "6948.86",
        "markPrice": "7194.0717439",
        "markIV": "0.490087689370473",
        "underlyingPrice": "62142.5973392596",
        "breakEvenPrice": "61955.80886",
        "initialMargin": "0",
        "realizedPnl": "0",
        "unrealizedPnl": "245.2117439",
        "updatedAt": 1783079880460
      }
    ],
    "statusCode": 200,
    "clientRequestId": "b8c56794-c7f8-467d-b331-be8c765a5378"
  }
}
```

| Field                              | Type   | Required | Description                                    |
| ---------------------------------- | ------ | -------- | ---------------------------------------------- |
| `resultType`                       | string | Yes      | `optionsPositions`                             |
| `market`                           | string | Yes      | Contract name                                  |
| `data.positions[].market`          | string | Yes      | Contract name                                  |
| `data.positions[].side`            | string | Yes      | `long` or `short`                              |
| `data.positions[].optionType`      | string | Yes      | `call` or `put`                                |
| `data.positions[].qty`             | string | Yes      | Position quantity                              |
| `data.positions[].value`           | string | Yes      | Position value                                 |
| `data.positions[].entryPrice`      | string | Yes      | Average entry price                            |
| `data.positions[].markPrice`       | string | Yes      | Current mark price                             |
| `data.positions[].markIV`          | string | Yes      | Mark implied volatility                        |
| `data.positions[].underlyingPrice` | string | Yes      | Underlying index price                         |
| `data.positions[].breakEvenPrice`  | string | Yes      | Break-even price                               |
| `data.positions[].initialMargin`   | string | Yes      | Initial margin (short positions; `0` for long) |
| `data.positions[].realizedPnl`     | string | Yes      | Realized PnL                                   |
| `data.positions[].unrealizedPnl`   | string | Yes      | Unrealized PnL                                 |
| `data.positions[].updatedAt`       | number | Yes      | Last update (ms since epoch)                   |
| `data.statusCode`                  | number | Yes      | `200`                                          |
| `data.clientRequestId`             | string | No       | Client-generated UUID for correlation          |

### Position Updates

`optionsPositionsDelta` messages carry changed positions in the same shape under
`data.positions`.
