Messages
{
"op": "sub",
"id": 1,
"t": "l2Delta@f",
"m": "0x8121EE960066e4344A213F9aC7502395502aEe7a",
"feedEpoch": 0,
"seq": 1022
}Exchange WebSocket methods
L2 delta stream
Bootstrap, replay, and follow finalized order-book changes.
WSS
/
ws
l2Delta@f
(feedEpoch, marketSeq).
Without seq, the stream sends a finalized L2 snapshot, replays retained deltas
after that snapshot, and then joins live updates. With seq, replay begins
strictly after the supplied cursor and no bootstrap snapshot is sent.
Subscribe
{
"op": "sub",
"id": 1,
"t": "l2Delta@f",
"m": "0x8121EE960066e4344A213F9aC7502395502aEe7a",
"feedEpoch": 0,
"seq": 1022
}
m is required. seq is optional and must be greater than zero when supplied.
feedEpoch is required whenever seq is present. Coalescing durations and L2
formatting options are not accepted.
Decoded event
The shape below is the innermessage returned by decodeExchangeWsEnvelope
or decodeExchangeWsMessage. Every binary socket message also carries an outer
id: bigint, matching your subscription ID. Use it to route snapshots, replay,
and live updates. See binary subscription envelopes.
interface ExchangeWsL2DeltaFrame {
wireVersion: 1;
feedEpoch: bigint;
view: "finalized";
kind: "l2Delta";
marketAddress: string;
marketSeq: bigint;
previousMarketSeq: bigint | null;
globalSeq: bigint;
sourceBlock: { blockNumber: bigint; blockId: string };
updates: Array<{
side: "buy" | "sell";
price: bigint;
totalBaseAfter: bigint;
activeBaseAfter: bigint;
passiveBaseAfter: bigint;
activeOrderCountAfter: number;
}>;
}
price is an integer in market price precision (pp). The base fields use the
market’s native size precision; totalBaseAfter === 0n deletes the level.
previousMarketSeq is the previous publication in this exact market, view,
and topic stream. A zero wire value decodes to null. For a replay requested
after R, the first frame is a valid sparse bridge when marketSeq > R and
previousMarketSeq is null or at most R; every later frame must point
exactly to the last accepted marketSeq.Messages
{
"op": "sub",
"id": 1,
"t": "l2Delta@f",
"m": "0x8121EE960066e4344A213F9aC7502395502aEe7a",
"feedEpoch": 0,
"seq": 1022
}l2Delta@f subscription
type:object