Orderbook

Retrieve the live orderbook for a market.

Get Orderbook

Returns the current orderbook snapshot for a market.

GET /api/v1/orderbook/{marketId}

Path Parameters

ParameterTypeDescription
marketIdbytes32Market identifier

Query Parameters

ParameterTypeRequiredDescription
outcomestringNoFilter by outcome: YES or 0, NO or 1. If omitted, returns all orders.

Response

{
  "marketId": "0x1234...abcd",
  "bids": [
    {
      "price": 500000,
      "size": 10000000
    },
    {
      "price": 490000,
      "size": 20000000
    }
  ],
  "asks": [
    {
      "price": 520000,
      "size": 15000000
    }
  ],
  "lastUpdate": 1735689000
}
FieldTypeDescription
marketIdbytes32Market identifier
bidsarrayBuy orders sorted by price descending (best bid first)
asksarraySell orders sorted by price ascending (best ask first)
lastUpdateuint64Unix timestamp of last orderbook update

Price Level Fields

FieldTypeDescription
priceuint64Price in USDC (6 decimals). 500000 = $0.50
sizeuint64Total size at this price level (6 decimals). 10000000 = 10 shares

Per-Outcome Orderbooks

YES and NO each have separate orderbooks. A BUY YES order only matches against SELL YES orders, never SELL NO.

When you specify outcome=YES, you get the YES orderbook:

  • Bids: Users wanting to buy YES tokens
  • Asks: Users wanting to sell YES tokens
If no orderbook exists for a market, an empty snapshot is returned with `bids: []` and `asks: []`.

Examples

# All orders (both YES and NO)
curl "https://api.turbinefi.com/api/v1/orderbook/0x1234...abcd"

# YES orderbook only
curl "https://api.turbinefi.com/api/v1/orderbook/0x1234...abcd?outcome=YES"

# NO orderbook only
curl "https://api.turbinefi.com/api/v1/orderbook/0x1234...abcd?outcome=NO"