SUB wss://test-api.synquote.com/ws
Receive notifications about changes to the order book for a certain instrument.
SUBSCRIBE
HEADER PARAMS
msg_type string required |
id number required |
version integer required |
BODY PARAMS
channel array of strings required |
Example
[
{
"msg_type": "add_subscriptions",
"id": 1002,
"version": 1
},
{
"channels": ["market_data.orderbook_updates.ETH-PERPETUAL"]
}
]NOTIFICATION
is_initial_snapshot
boolean | ||||
asksarray of array of strings
| ||||
bidsarray of array of strings
| ||||
market_seqno
string | ||||
transaction_ts
string |
Example
[
{
"id": 74263,
"msg_type": "market_data.orderbook_updates.ETH-PERPETUAL",
"version": 1
},
{
"asks": [],
"bids": [["3815.5", "498.1"]],
"is_initial_snapshot": false,
"market_seqno": 123456,
"transaction_ts": "1726080879628498287"
}
]Behavior
The first notification will contain a snapshot of the entire order book, all following notifications will contain only price levels that have changed.
- is_initial_snapshot: Set to
true, indicating this is the initial view of the book. - transaction_ts: The time the order book update occurred in UNIX epoch nanoseconds. If
is_initial_snapshotistrue, it is the time of the most recent order book update. - bids/asks: An array detailing changes to the bid/ask side of the book. The array may be empty if no changes occurred, but at least one side (bid or ask) will have changes. Each entry includes an array containing two strings with the following values:
- 1 (Price): Listed in decreasing order for bids and increasing order for asks.
- 2 (Size): Total tradable size of all orders at this price level.
