- Topic:
orderbook.<depth>.<symbol>(e.g.,orderbook.1.BTC-USDC) - Stream: Public (
wss://api.ekiden.fi/ws/public)
Subscribe
Events
Messages arrive withop: "event", topic: "orderbook.<depth>.<symbol>", include type (snapshot or delta), and data is an OrderBookSnapshot.
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. - In the payload, asks are
aand bids areb. tsandmtsare Unix timestamps in milliseconds (encoded as strings).server_ts_msis the gateway processing time in milliseconds.- All numeric values in
dataare strings to preserve precision.
OrderBookSnapshot.