Market Info Websocket
Public WebSocket channels for real-time market data. No SIWE authentication required, but the upgrade requires an _idx_session cookie — see Session Cookie.
Connection
wss://api.t.synchronicity.xyz/indexer-ws/wsPrime the cookie with GET /indexer/session, then open the upgrade with Cookie: _idx_session=…. A missing or invalid cookie returns 403 at upgrade time; the 403 response carries a fresh cookie in Set-Cookie — capture it and retry. See Session Cookie — WebSocket for the full handshake.
All messages are JSON.
Errors
All errors use the format:
{
"type": "error",
"message": "descriptive error message"
}Channels
orderbook_depth
Orderbook price levels. No authentication required.
Subscribe:
{
"action": "subscribe",
"channel": "orderbook_depth",
"orderbook_ids": [123, 456]
}Snapshot: None. Updates are only sent when a batch is cleared.
Update:
{
"type": "orderbook_depth_updated",
"orderbook_id": 123,
"depth": {
"orderbook_id": 123,
"bids": [{ "price": "50000.00", "volume": "10.5" }],
"asks": [{ "price": "50001.00", "volume": "15.0" }],
"midpoint": "50000.50",
"spread": "1.00",
"timestamp": 1704067200000
}
}| Field | Type | Description |
|---|---|---|
type | "orderbook_depth_updated" | Event type identifier |
orderbook_id | number | The order book that was updated |
depth.bids | PriceLevel[] | Bid price levels, sorted by price descending (best bid first) |
depth.asks | PriceLevel[] | Ask price levels, sorted by price ascending (best ask first) |
depth.midpoint | decimal string | Midpoint between best bid and best ask |
depth.spread | decimal string | Difference between best ask and best bid |
depth.timestamp | number | Unix timestamp (ms) of when depth was calculated |
PriceLevel Object:
| Field | Type | Description |
|---|---|---|
price | decimal string | Price level |
volume | decimal string | Total size available at this price level |
This is a full snapshot replacement, not a delta. Replace the entire order book depth with this data.
orderbook_depth_pre_clearance
Orderbook depth snapshot captured right before the FBA (Frequent Batch Auction) is run — this is the exact book state that the clearing algorithm operates on. Only sent when bids and asks cross; if no cross occurs in a batch cycle, no snapshot is emitted. Useful for understanding how clear_price was calculated and for visualising FBA behaviour. No authentication required.
When subscribed to both channels, orderbook_depth_pre_clearance is always delivered before orderbook_depth_updated within the same batch cycle.
Subscribe:
{
"action": "subscribe",
"channel": "orderbook_depth_pre_clearance",
"orderbook_ids": [123, 456]
}Unsubscribe:
{
"action": "unsubscribe",
"channel": "orderbook_depth_pre_clearance",
"orderbook_ids": [123, 456]
}Snapshot: None. Sent only when a batch has fills.
Update:
{
"type": "orderbook_depth_pre_clearance",
"orderbook_id": 123,
"depth": {
"orderbook_id": 123,
"bids": [{ "price": "50000.00", "volume": "10.5" }],
"asks": [{ "price": "50001.00", "volume": "15.0" }],
"midpoint": "50000.50", // ignore — not meaningful for crossed bids/asks
"spread": "1.00", // ignore — not meaningful for crossed bids/asks
"timestamp": 1704067200000
},
"clear_price": "50000.75",
"clear_volume": "5.0"
}Same shape as orderbook_depth_updated — see the field table in orderbook_depth above — plus two additional fields:
| Field | Type | Description |
|---|---|---|
clear_price | string | The price at which the batch was cleared |
clear_volume | string | The total volume filled in the batch |
orderbook_bbo
Best bid and offer (top-of-book). Lightweight alternative to orderbook_depth — sends only the best bid and best ask with their volumes. No authentication required.
Subscribe:
{
"action": "subscribe",
"channel": "orderbook_bbo",
"orderbook_ids": [123, 456]
}Snapshot: None. Updates are only sent when a batch is cleared.
Update:
{
"type": "bbo_updated",
"orderbook_id": 123,
"bid": { "price": "50000.00", "volume": "10.5" },
"ask": { "price": "50001.00", "volume": "15.0" },
"timestamp": 1704067200000
}| Field | Type | Description |
|---|---|---|
type | "bbo_updated" | Event type identifier |
orderbook_id | number | The order book that was updated |
bid | PriceLevel | null | Best bid price level, or null if no bids |
ask | PriceLevel | null | Best ask price level, or null if no asks |
timestamp | number | Unix timestamp (ms) |
bid and ask use the same PriceLevel object as orderbook_depth (price and volume as decimal strings). Either side can be null if that side of the book is empty.
orderbook_trades
Batch trade notifications. No authentication required.
Subscribe:
{
"action": "subscribe",
"channel": "orderbook_trades",
"orderbook_ids": [123, 456]
}Snapshot: None.
Update:
{
"type": "batch_traded",
"orderbook_id": 123,
"price": "50000.00",
"size": "50.5",
"timestamp": 1704067200000
}| Field | Type | Description |
|---|---|---|
type | "batch_traded" | Event type identifier |
orderbook_id | number | The order book this trade occurred on |
price | decimal string | Clearing price |
size | decimal string | Total size matched |
timestamp | number | Unix timestamp (ms) |
Sent once per batch when the batch is cleared.
orderbook_context
Mark price, index price, 24h stats, funding, and open interest. No authentication required.
Subscribe:
{
"action": "subscribe",
"channel": "orderbook_context",
"orderbook_ids": [123, 456]
}Snapshot: Sent on subscribe.
Update:
{
"type": "orderbook_context_updated",
"orderbook_id": 123,
"mark_price": "50000.00",
"index_price": "50010.50",
"price_24h_ago": "48000.00",
"change_24h": "4.17",
"volume_24h": "1000000.50",
"open_interest": "5000.0",
"funding_rate": "0.0001"
}| Field | Type | Description |
|---|---|---|
type | "orderbook_context_updated" | Event type identifier |
orderbook_id | number | Orderbook identifier |
mark_price | decimal string | Current mark price |
index_price | decimal string | Current index price |
price_24h_ago | decimal string | Price 24 hours ago |
change_24h | decimal string | 24h change percentage |
volume_24h | decimal string | 24h trading volume |
open_interest | decimal string | Total open interest |
funding_rate | decimal string | Current funding rate |
candles
Candlestick OHLCV data. No authentication required.
Subscribe:
{
"action": "subscribe",
"channel": "candles",
"orderbook_ids": [123],
"intervals": ["1m", "5m", "1h"]
}Valid intervals: 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1d, 3d, 1w, 1M
Snapshot: None.
Update:
{
"type": "candle_updated",
"t": 1704067200000,
"T": 1704067260000,
"s": "BTC/USD",
"i": "1m",
"o": "50000.00",
"c": "50100.50",
"h": "50150.00",
"l": "49950.00",
"v": "100.5",
"n": 50
}| Field | Description |
|---|---|
t | Open time (ms) |
T | Close time (ms) |
s | Symbol |
i | Interval |
o | Open |
c | Close |
h | High |
l | Low |
v | Volume |
n | Trade count |
all_mids
Mid-prices for all orderbooks, broadcast every 150ms. No authentication required.
Subscribe:
{
"action": "subscribe",
"channel": "all_mids"
}No orderbook_ids parameter — this is a global channel that covers all orderbooks.
Snapshot: None.
Update:
{
"type": "all_mids_updated",
"mids": {
"1": "50000.50",
"2": "3200.25",
"3": "150.123"
}
}| Field | Type | Description |
|---|---|---|
type | "all_mids_updated" | Event type identifier |
mids | object | Map of orderbook ID (string) to mid-price (decimal string) |
Mid-prices are calculated as (bestBid + bestAsk) / 2 and cached on each batch clear. The channel broadcasts the latest cached values every 150ms.
Snapshot Summary
| Channel | Snapshot on subscribe? |
|---|---|
orderbook_depth | No |
orderbook_depth_pre_clearance | No |
orderbook_bbo | No |
orderbook_trades | No |
orderbook_context | Yes |
candles | No |
all_mids | No |
Data Types
- All numeric values (prices, volumes, balances) are strings to preserve precision.
- Timestamps are milliseconds (Unix epoch).
is_bid:true= buy,false= sell.orderbook_id: uint64.