Skip to content

how to ensure data consistency when using Depth subscription ? #19

Open

Description

@illusionoff

Depth subscription version 3 : https://www.gate.io/docs/websocket/index.html?javascript#depth-subscription
When subscribing, 'depth.subscribe', ["ETH_USDT", 5, "0.0001"]
The first message comes with a value:
{ "method": "depth.update", "params": [ **_true_**, { asks: [Array], bids: [Array], **_id: 1736394129_** },
Аnd contains the complete specified,in this case "5" ORDERBOOK and id.
But subsequent messages with a value of false do not contain an id.
How can you know for sure that a message has not been lost without comparing the id?

Activity

  1. revilwang commented on Jul 14, 2021

    @revilwang
    Collaborator

    We suggest using the new WebSocket v4 instead.

  2. illusionoff commented on Jul 14, 2021

    @illusionoff
    Author

    Unfortunately there is no documentation for javascript v.4 . Im Junior

    And yet, maybe you can advise how this functionality was provided in v3?

  3. revilwang commented on Jul 14, 2021

    @revilwang
    Collaborator

    The bad news is that there is no certain way to check order book consistency in v3. We are planing to support v4 websocket with JavaScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions