{
"op": "auth",
"bearer": "<JWT>",
"req_id": "200001"
}{
"op": "subscribe",
"args": [
"orderbook/0x88a70ff..."
],
"req_id": "100001"
}{
"op": "unsubscribe",
"args": [
"orderbook/0x88a70ff..."
],
"req_id": "100002"
}{
"op": "ping",
"ts": 1681234567890123000,
"req_id": "100003"
}{
"op": "auth",
"success": true,
"user_id": "0x88a70ff...",
"req_id": "200001"
}{
"op": "subscribed",
"args": [
"orderbook/0x88a70ff..."
],
"req_id": "100001"
}{
"op": "unsubscribed",
"args": [
"orderbook/0x88a70ff..."
],
"req_id": "100002"
}{
"op": "pong",
"req_id": "100003",
"client_ts": 1681234567890123000,
"server_ts": 1681234567890123500
}{
"op": "error",
"message": "INVALID_TOPIC_FOR_PUBLIC_WS: position",
"req_id": "100004"
}{
"op": "event",
"topic": "orderbook/0x88a70ff...",
"data": {
"market_addr": "0x88a70ff...",
"seq": 123,
"bids": [
{
"price": "100.1",
"qty": "5"
}
],
"asks": [
{
"price": "100.2",
"qty": "3"
}
],
"ts": 1681234567890123500
}
}The private channel is used for subscribing to user-specific data.
{
"op": "auth",
"bearer": "<JWT>",
"req_id": "200001"
}{
"op": "subscribe",
"args": [
"orderbook/0x88a70ff..."
],
"req_id": "100001"
}{
"op": "unsubscribe",
"args": [
"orderbook/0x88a70ff..."
],
"req_id": "100002"
}{
"op": "ping",
"ts": 1681234567890123000,
"req_id": "100003"
}{
"op": "auth",
"success": true,
"user_id": "0x88a70ff...",
"req_id": "200001"
}{
"op": "subscribed",
"args": [
"orderbook/0x88a70ff..."
],
"req_id": "100001"
}{
"op": "unsubscribed",
"args": [
"orderbook/0x88a70ff..."
],
"req_id": "100002"
}{
"op": "pong",
"req_id": "100003",
"client_ts": 1681234567890123000,
"server_ts": 1681234567890123500
}{
"op": "error",
"message": "INVALID_TOPIC_FOR_PUBLIC_WS: position",
"req_id": "100004"
}{
"op": "event",
"topic": "orderbook/0x88a70ff...",
"data": {
"market_addr": "0x88a70ff...",
"seq": 123,
"bids": [
{
"price": "100.1",
"qty": "5"
}
],
"asks": [
{
"price": "100.2",
"qty": "3"
}
],
"ts": 1681234567890123500
}
}Authenticate the connection on the private channel using a bearer token (e.g., JWT). Server responds with AuthResponse.
Subscribe to a public topics. Server will respond with a Subscribed message.
Unsubscribe from a public topics. Server will respond with an Unsubscribed message.
Ping the server. The server will respond with a Pong message. Client can use ts to measure RTT.
Response to an Auth request. Indicates whether authentication succeeded.
Acknowledgement for a successful Subscribe request. Echoes the list of topics.
Acknowledgement for a successful Unsubscribe request. Echoes the list of topics.
Heartbeat response to a Ping request. Includes the server timestamp in nanoseconds and echoes client_ts to help client measure RTT.
Standard error response for invalid requests, authorization failures, or policy violations (e.g., rate limits).
Unified event envelope. data can be one of public market updates or private user updates.
OrderbookSnapshot, OrderbookDelta, AggregatedTrades, TickerSnapshotOrderResponse, FillResponse, PositionResponse