Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket : OrderBook : Data sent is pre-maching-engine data, yielding "invalid" order books #221

Open
kgoderis opened this issue Dec 15, 2023 · 0 comments

Comments

@kgoderis
Copy link

Just seeking a confirmation, but it seems that the updates sent over the web socket are updates of the order book before they got matched by the exchange matching engine. I observe for example message sequences such as this one:

{
  "type" : "channel_data",
  "connection_id" : "17acef48-0628-4d2a-9115-5e8574a03418",
  "message_id" : 550589,
  "id" : "ETH-USD",
  "channel" : "v3_orderbook",
  "contents" : {
    "offset" : "36003283357",
    "bids" : [ ],
    "asks" : [ [ "2244.1", "21.982" ] ]
  }
} 
{
  "type" : "channel_data",
  "connection_id" : "17acef48-0628-4d2a-9115-5e8574a03418",
  "message_id" : 550600,
  "id" : "ETH-USD",
  "channel" : "v3_orderbook",
  "contents" : {
    "offset" : "36003283744",
    "bids" : [ [ "2244.1", "8.154" ] ],
    "asks" : [ ]
  }
} 

When performing the updates to an order book structure stored by the client, you would end up with an order book whereby the nearest bid and ask are at the same level, and thus equal to the mid price, e.g. spread would be 0. IMO this should never be the case

Later on I get:

{
  "type" : "channel_data",
  "connection_id" : "17acef48-0628-4d2a-9115-5e8574a03418",
  "message_id" : 550625,
  "id" : "ETH-USD",
  "channel" : "v3_orderbook",
  "contents" : {
    "offset" : "36003283370",
    "bids" : [ ],
    "asks" : [ [ "2244.1", "20" ] ]
  }
} 
{
  "type" : "channel_data",
  "connection_id" : "17acef48-0628-4d2a-9115-5e8574a03418",
  "message_id" : 550634,
  "id" : "ETH-USD",
  "channel" : "v3_orderbook",
  "contents" : {
    "offset" : "36003283425",
    "bids" : [ ],
    "asks" : [ [ "2244.1", "0" ] ]
  }
} 

Expected behaviour would that updates are sent after matching by the matching-engine, so that the bids @ 2244.1 level is to 0, and the ask is set at the open amount after matching

Is this by design?

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

No branches or pull requests

1 participant