Does websocket snapshot and l2update offer checksum?

Endpoint: wss://ws-feed.exchange.coinbase.com

// Request
{
    "type": "subscribe",
    "product_ids": [
        "ETH-USD",
        "BTC-USD"
    ],
    "channels": ["level2"]
}

Based on my testing results, I don’t see a checksum shown in the response of either snapshot or l2update messages.

For example,

{"type":"l2update","product_id":"ETH-USD","changes":[["sell","3086.12","0.84646646"]],"time":"2022-04-20T02:50:51.653160Z"}

Question>
When I build an orderbook based on snapshot and l2update, how can I validate that my book is correct?

Thank you

Hi @q0987, please refer to the items below for answers to your questions:

  • No checksum is provided over Websocket.
  • Noting this section from the documentation: “Subscribe to the level2 channel to guarantee that messages are delivered and your order book is in sync”. From that, we would recommend using the full channel and taking what you need + utilising sequence numbers and tracking them to ensure they are in the correct state.

Please see references below:

3 Likes