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

# The YES-side book

> One order book per market, the YES side; the NO view on request; and which outcome is YES when the labels aren't Yes and No.

Every market has two outcomes, YES and NO, and one order book. The API serves it as the **YES book**: bids and asks for the YES outcome, best first.

The two outcomes of a market are two views of the same book.

* On Kalshi, a NO bid at a price p is a YES ask at 1 − p.
* On Polymarket, the market's two tokens mirror each other, so the YES token's book is the market's whole book. Never add the two books together: you would count every order twice.

So there is nothing to merge and nothing to choose. Every price endpoint reads the YES book unless you ask otherwise.

## The NO view

Add `outcome=no` to any price endpoint (prices, candles, books, best bid and ask, book changes, trades) to read the market from the NO side. Prices become 1 − p, bids and asks swap, candle highs and lows swap, and a trade's aggressor flips.

```bash YES (default) theme={null}
curl -s "https://api.qelso.io/v2/markets/polymarket:3215007/books?at=2026-11-16T15:00:00.000Z&depth=1" \
  -H "X-API-Key: $QELSO_API_KEY"
```

```bash NO theme={null}
curl -s "https://api.qelso.io/v2/markets/polymarket:3215007/books?at=2026-11-16T15:00:00.000Z&depth=1&outcome=no" \
  -H "X-API-Key: $QELSO_API_KEY"
```

```json theme={null}
{
  "market": {
    "id": "polymarket:3215007",
    "outcomes": {"yes": {"label": "Yes", "token_id": "4286572874…"}, "no": {"label": "No", "token_id": "8077351031…"}}
  },
  "outcome": "yes",
  "interval": null,
  "depth": 1,
  "data": [
    {"t": "2026-11-16T15:00:00.000Z", "bids": [[0.033, 9969.09]], "asks": [[0.034, 4198.74]], "last_change": "2026-11-16T14:59:56.643Z"}
  ],
  "next_cursor": null
}
```

The `market` object and the token IDs are shortened here. With `outcome=no`, the same book reads as bids `[[0.966, 4198.74]]` and asks `[[0.967, 9969.09]]`: the YES ask of 4,198.74 shares at 0.034 is a NO bid at 0.966.

## Which outcome is YES

Every market object, and the `market` object at the top of every history response, names both outcomes in `outcomes`.

On Kalshi, every market is one yes/no question. YES carries the market's own short line, such as "Fed maintains rate" or "Over 9.5 points", or "Yes" when it has none, and NO is "No".

On Polymarket, many markets have outcomes other than "Yes" and "No", such as two teams, "Over" and "Under", or "Up" and "Down". On those, YES is the venue's first-listed outcome and NO the second.

```json theme={null}
"outcomes": {"yes": {"label": "Browns", "token_id": "…"}, "no": {"label": "Steelers", "token_id": "…"}}
```

So a price of 0.62 on that market is the price of "Browns", and `outcome=no` gives the price of "Steelers".

## Prices and sizes

* Prices are numbers from 0 to 1, in dollars per \$1 contract, which is the implied probability. They have up to 6 decimals, on every venue.
* Sizes are in contracts on Kalshi and shares on Polymarket, with up to 6 decimals.
* `mid` is (bid + ask) / 2. An empty bid counts as 0 and an empty ask as 1, so a one-sided book still has a mid. It is null when both sides are empty.

Scalar markets (`market_type: scalar`) settle anywhere from 0 to 1; `settlement_value` gives what a YES contract paid. A Polymarket market that resolved 50-50 shows `result: scalar` with a `settlement_value` of 0.5.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.