> For the complete documentation index, see [llms.txt](https://docs.strikelabs.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.strikelabs.app/api-reference/exchange.md).

# Exchange endpoint

Authenticated actions: place orders, cancel, replace a maker ladder, read your own account.

Every request here needs a token from [Authentication](/api-reference/authentication.md):

```
x-paper-token: <token>
```

A missing, unknown or expired token returns `401`.

## Account

```bash
curl https://api.strikelabs.app/v1/me -H 'x-paper-token: <token>'
```

```json
{
  "cash": 9998.15,
  "equity": 9998.15,
  "buyingPower": 9998.15,
  "realizedPnl": -1.84,
  "unrealizedPnl": -1.16,
  "maintenanceMargin": 0,
  "marginCall": false,
  "openOrderCount": 0,
  "openOrders": [],
  "positions": [
    {
      "seriesId": "NVDA-1786492800-C-221",
      "symbol": "NVDA",
      "optType": "call",
      "strike": 221.0,
      "expiryTs": 1786492800,
      "qty": 2.0,
      "avgPrice": 0.96,
      "mark": 0.38,
      "realized": 0.0,
      "unrealized": -1.16
    }
  ]
}
```

| Field                    | Meaning                                                                                         |
| ------------------------ | ----------------------------------------------------------------------------------------------- |
| `cash`                   | Settled cash. Premium and fees have already moved.                                              |
| `equity`                 | Cash plus the mark value of open positions.                                                     |
| `buyingPower`            | What you can still deploy, after margin held against shorts.                                    |
| `realizedPnl`            | Realised P\&L to date.                                                                          |
| `unrealizedPnl`          | Mark-to-market across all open positions.                                                       |
| `maintenanceMargin`      | Margin currently required to keep your shorts.                                                  |
| `marginCall`             | `true` when equity is under maintenance. While set, only position-reducing orders are accepted. |
| `openOrderCount`         | Your true resting-order count — **not** `openOrders.length`, which is capped.                   |
| `openOrders`             | Your resting orders, capped at 500.                                                             |
| `positions[].qty`        | Signed. Negative is short.                                                                      |
| `positions[].avgPrice`   | Average premium paid or received per contract.                                                  |
| `positions[].mark`       | Current mark.                                                                                   |
| `positions[].realized`   | Realised P\&L booked on that series.                                                            |
| `positions[].unrealized` | Mark-to-market on that position.                                                                |

`openOrders` is **capped at 500 entries**, which is why `openOrderCount` exists: a maker with a full board sees a truncated list and an honest count. This is a view for humans and dashboards — do not rebuild order state from it; track your own.

## Place an order

```bash
curl -X POST https://api.strikelabs.app/v1/order \
  -H 'content-type: application/json' \
  -H 'x-paper-token: <token>' \
  -d '{
    "seriesId": "NVDA-1786492800-C-221",
    "side": "buy",
    "qty": 2,
    "price": 0.41
  }'
```

| Field      | Required | Meaning                                   |
| ---------- | -------- | ----------------------------------------- |
| `seriesId` | yes      | The contract.                             |
| `side`     | yes      | `buy` or `sell`.                          |
| `qty`      | yes      | Contracts. Fractional allowed.            |
| `price`    | no       | Limit price. **Omit for a market order.** |

```json
{
  "status": "filled",
  "orderId": 84213,
  "fills": [ { "price": 0.41, "qty": 2.0 } ],
  "restedQty": 0.0,
  "account": { "…": "your account, refreshed" }
}
```

The response carries your **updated account** so you do not need a follow-up read to know your new cash and positions.

`status` is one of `filled`, `partial`, `rested`, `cancelled` or `rejected`. A rejection returns HTTP `400` with a `reason` — see [Error responses](/api-reference/errors.md).

Closing a position is just the opposing order: sell what you are long, buy back what you are short. There is no separate close call and no position flag to set.

### Order types

There are two, and the distinction is only whether `price` is present.

* **Limit** — rests if it does not cross.
* **Market** — omit `price`. Crosses what is resting, never rests. An unfilled remainder is cancelled rather than left on the book.

## Cancel

```bash
curl -X POST https://api.strikelabs.app/v1/cancel \
  -H 'content-type: application/json' \
  -H 'x-paper-token: <token>' \
  -d '{"symbols": ["NVDA"]}'
```

| Field       | Meaning                                                        |
| ----------- | -------------------------------------------------------------- |
| `symbols`   | Array of underlyings. Cancels all your resting orders in each. |
| `symbol`    | Single underlying, a convenience form of the above.            |
| *(neither)* | Cancels **everything you have resting, in every symbol.**      |

```json
{ "ok": true, "pulled": 412 }
```

`pulled` is the number of orders removed. `ok` is `false` when nothing matched, which is not an error.

Scoping to `symbols` matters for a sharded maker: a shard shutting down should pull its own slice, not its siblings' books.

## Replace a quote ladder

> **Not a public endpoint.** `/v1/quotes` is the legacy unsigned ladder push. It rests real orders and has **no signed form**, so the venue refuses it outright with `401` whenever signatures are mandatory — which includes all of `deposits` mode. It is classified operator/maker-only and is documented here for the maker's own reference only.
>
> **If you are integrating against Strike, place signed orders with `POST /v1/order`.** Building against this path means building against something that is closed exactly when it would matter.

For market makers. One call diffs an entire board against what you already have resting and moves only what changed — far cheaper than a stream of individual orders and cancels.

```bash
curl -X POST https://api.strikelabs.app/v1/quotes \
  -H 'content-type: application/json' \
  -H 'x-paper-token: <token>' \
  -d '{
    "rows": [
      [259, [[0.35, 5447], [0.34, 8000]], [[0.41, 5447]], 0.366307, 0.254581]
    ]
  }'
```

Each compact row is a positional array:

| Cell | Meaning                                             |
| ---- | --------------------------------------------------- |
| `0`  | `sid` — the integer series alias from `/v1/series`. |
| `1`  | Bids: array of `[price, qty]`, best first.          |
| `2`  | Asks: array of `[price, qty]`.                      |
| `3`  | Your fair IV for the series (optional).             |
| `4`  | Your delta for the series (optional).               |

Cells 3 and 4 are annotations. They do not affect matching; they are what the chain surfaces as `iv` and `delta` to everyone reading the board. Omit them and the chain shows no analytics for that series.

For a side, pass `null` to leave it **unchanged**, or `[]` to **pull** it.

```json
{ "applied": 1284, "kept": 9902, "errors": 0, "rowErrors": [] }
```

| Field         | Meaning                                                                                                                   |
| ------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `applied`     | Series whose resting orders changed.                                                                                      |
| `kept`        | Series already at the requested ladder — no work done.                                                                    |
| `errors`      | Count of malformed rows.                                                                                                  |
| `rowErrors`   | The first 20 malformed rows, each `{ i, error }` with `i` the row index.                                                  |
| `unknownSids` | Sids the venue does not recognise, usually stale after a roll. **Present only when non-empty** — do not index it blindly. |

### Verbose form

When you do not yet know a series' `sid` — every series the daily roll just created — send `quotes` instead of `rows`, keyed by `seriesId`:

```json
{
  "quotes": [
    {
      "seriesId": "NVDA-1786492800-C-221",
      "bids": [[0.35, 5447]],
      "asks": [[0.41, 5447]],
      "iv": 0.366307,
      "delta": 0.254581
    }
  ]
}
```

Same semantics, larger payload. Use it to bootstrap, then switch to compact rows once you have cached the sids.

### Binary wire

There is also a binary encoding of this endpoint — magic `SQW1` for requests, `SQR1` for responses, negotiated by `content-type: application/x-strike-quotes` — used by the house maker to push the full board several times a second. It is an internal optimisation and not required to quote; the JSON forms above are the supported interface.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.strikelabs.app/api-reference/exchange.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
