market.orderbook is a public market-scoped channel. Authentication: none. Payload schema: RealtimeMarketOrderbookPayload. Source status: derived. The incremental watchOrderBook stream for one market, the same for spot and perpetual markets. Send marketId; the accepted frame says limit, the levels per side (50). The first frame after the accepted frame has type: "snapshot": it replaces your whole book and its nonce is the engine book sequence (the nonce of GET /v2/markets/{symbol}/book). A type: "delta" frame lists only the changed levels as [price, amount]; amount 0 removes the level. Apply a delta only when its previousNonce equals the nonce you hold, then hold its nonce; when it does not, you missed a frame: subscribe again without fromSequence for a new snapshot. A fromSequence resume always answers resync_required, because this channel keeps no history. checksum is the unsigned CRC32 of priceAtoms:sizeAtoms of bid 1, ask 1, bid 2, ask 2 and so on, joined by : (a side with no level at a depth is skipped, the OKX rule), over the book after the frame, with the atom values from info; a mismatch also means subscribe again. A snapshot frame also comes every 30 s while the book does not change: replace your book with it. timestamp and datetime are the time this server published the frame, not an engine time. If the engine sequence starts lower again (an engine reset), a new snapshot comes with the lower nonce: replace your book and hold that nonce. Frames come about once a second per market, as market.book; market.book itself does not change.

Subscribe envelope

Send this exact JSON shape. requestId is required and there is no action field. The series field is not sent for this channel.

Accepted frame

The subscription is active only after a matching realtime-subscription-accepted/v1 frame arrives.

Data frame

The envelope is realtime-stream/v1; its payload validates against RealtimeMarketOrderbookPayload.

Worked example

  1. Send the subscribe envelope with request id subscribe-market-orderbook.
  2. Wait for the accepted frame with the same request id; receiving any other frame does not prove this subscription.
  3. Process the data frame at sequence 1 and validate its payload as RealtimeMarketOrderbookPayload.