Skip to content

Conversation

@v36u
Copy link
Contributor

@v36u v36u commented Sep 26, 2024

This idea came while looking over Bybit's API:

Once you have subscribed successfully, you will receive a snapshot. The WebSocket will keep pushing delta messages every time the orderbook changes. If you receive a new snapshot message, you will have to reset your local orderbook. If there is a problem on Bybit's end, a snapshot will be re-sent, which is guaranteed to contain the latest data.

https://bybit-exchange.github.io/docs/v5/websocket/public/orderbook#process-snapshotdelta

It seems like common sense to reset the old orderbook when the new one is a full one. Also, the impact would be very reduced because the only ones that set IsFromSnapshot to true are Bybit and KuCoin.

I've also updated the readme to reflect that Bybit and KuCoin have orderbook websockets implemented.

@vslee vslee merged commit 3f24f4b into DigitalRuby:main Sep 26, 2024
@v36u v36u deleted the reset-orderbook-when-snapshot branch September 28, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants