- Topic:
orderbook/{market_addr} - Stream: Public (
wss://api.ekiden.fi/ws/public)
Subscribe
Events
Messages arrive withop: "event", topic: "orderbook/{addr}", and data being either a snapshot or a delta.
Snapshot example:
Building a Local Book
- On subscribe, wait for a snapshot, then apply subsequent deltas by ascending
seq. - Each price level is a two-element array
[price, size]. - Delta semantics: if
size === 0, delete the level atprice; otherwise upsert the level tosize. - If you detect a gap in
seq, resubscribe to receive a fresh snapshot.
Notes
- Arrays
asksandbidsare ordered by ascending price. timestampis a Unix timestamp in seconds.- Zero-change deltas: it is valid for one or both sides to be empty when no sizes changed for that side. Clients should treat such messages as a no-op and maintain their current local book. Servers may omit sending zero-change deltas entirely in future versions.
OrderbookSnapshot, OrderbookDelta.