Skip to content
UDX
On this page

Market Data

Compare L1, L2, and L3 order book views, then choose between REST snapshots and WebSocket updates for your integration.

L1, L2, and L3 describe how much of an order book you can see. The examples below are illustrative; use the API reference for the exact response shape.

L1: Best Prices

L1 shows the best available bid and ask with aggregate size. It does not include deeper price levels or last-trade information.

{
  "type": "orderbook_snapshot",
  "sid": 7,
  "seq": 1,
  "msg": {
    "ticker": "UDX-EXAMPLE-MARKET-A",
    "bids": [["0.54", "120"]],
    "asks": [["0.56", "80"]]
  }
}

Use L1 when you need the current spread but not the depth behind it.

L2: Price Levels

L2 shows the full price ladder with quantity aggregated at each price level. It does not expose individual orders.

{
  "orderbook": {
    "ticker": "UDX-EXAMPLE-MARKET",
    "bids": [
      ["0.540", "120"],
      ["0.530", "300"]
    ],
    "asks": [
      ["0.560", "80"],
      ["0.570", "250"]
    ]
  }
}

Each pair is [price, quantity]. The exchange prices the book from the YES side.

Use L2 to display depth, estimate available liquidity, or recover a local order book. The public REST snapshot uses this model. The WebSocket stream supports L1, L2, and L3 subscriptions, and uses L2 when level is omitted.

For L2 and L3 WebSocket subscriptions, omitting depth returns 25 price levels per side. Set depth to an integer from 1 through 100 for a specific limit, or to "full" for every visible price level. A full L3 book can be substantially larger than a full L2 book because it includes every resting order at each level.

L3: Individual Orders

L3 shows every individual resting order within the requested price depth, including its size, updates, and FIFO queue position. The WebSocket depth counts price levels per side, and each visible price level includes all of its resting orders.

{
  "type": "orderbook_snapshot",
  "sid": 7,
  "seq": 1,
  "msg": {
    "ticker": "UDX-EXAMPLE-MARKET-A",
    "bids": [
      {"entry_id": "01K5N8Y2A7Q0", "price": "0.54", "quantity": "50"},
      {"entry_id": "01K5N8Y2B19V", "price": "0.54", "quantity": "70"}
    ],
    "asks": []
  }
}

Array order is price-time priority. entry_id is an anonymous market-data handle; it is not the order ID returned to the order owner. An update changes quantity without changing priority. A quantity increase, reprice, or other priority reset is a delete followed by an add with the same entry_id; apply changes in array order.

An L3 stream can send another orderbook_snapshot after the initial snapshot when its source rebaselines. Treat every snapshot as complete replacement state: discard the local book for that subscription, replace it with the snapshot, and continue from its seq.

Use L3 when your integration needs order-level queue information. Subscribe over WebSocket with level: "L3"; L2 remains the default when level is omitted.

Trades

Trades are separate from the order book. A book shows resting liquidity; a trade is liquidity that was consumed. Every trade that stands is public, however it executed, so RFQ executions on multi-leg markets appear alongside order book matches. The exchange can void a trade after reporting it; a voided trade is retracted from the live stream and omitted from history. The Discovering Markets walkthrough shows how to read and follow trades.

Stats

Stats summarize a market’s trading activity, as distinct from its order book. Open interest is the number of YES contracts held long, which always equals the number held short because every market trades a single contract. Last price is the price of the most recent trade on any day.

Day figures cover the current trade day: the first, highest, and lowest trade prices, contracts traded, and dollars traded. A market that has not traded since the trade day roll reports zero volume and no day prices. Lifetime figures cover every trade since the market was listed.

Open interest, last price, and the day figures can be followed live; lifetime figures are read on request and can trail day figures. The Discovering Markets walkthrough shows how to read and follow them.

Snapshots and Streams

A snapshot is the book at one moment. A stream is a snapshot followed by every change, in order, so a local copy stays current without asking again. Market data is available both ways: read a snapshot when you need the book now, and subscribe to a stream when you need to keep it. The Discovering Markets walkthrough shows both.