MultiversX Tracker is Live!

Binance API: How to find cancellation events when you maintain a local orderbook with webstreams.

Binance

Cryptocoins Exchanges / Binance 224 Views

Binance API: How to find cancellation events when you maintain a local orderbook with webstreams.

Is it possible to get cancellation events when using the Binance webstreams to maintain a local orderbook?

From the official Binance API Docs ( https://binance-docs.github.io/apidocs/spot/en/#how-to-manage-a-local-order-book-correctly ), the way to maintain a local orderbook is the one described on the image bellow.

https://preview.redd.it/c6rtrb60tq981.png?732&format=png&auto=webp&s=8adfb3583a2766f868c46ca29def2f9089403bd6

My aim is to collect trading events and also maintain the orderbook locally. While i maintain my local orderbook, i can gather the submission of orders. These have an event type of "depthUpdate". By subscribing to the appropriate webstream i can also collect the trades that are performed. (buys/sells) My problem is that i dont see a way in which i can reliably collect the cancellation events (order cancellations). I thought that the cancellations would be in the depth stream however if that was the case you wouldnt need to retake a snapshot every now and then in order to maintain the orderbook correctly. If you dont retake snapshots then you just keep on adding price levels, since the only means of removing one is for it to have a quantity of 0. I also dont think that we can infer in a reliable way from step 8 that the price level that will be removed if the quantity is 0, is an actual order cancellation. Does anyone know if step 8 is indeed a cancellation of an order? If it is not has anyone found a way to also collect cancellation orders from the api?

Thanks in advance!

submitted by /u/Insomniac30
[link] [comments]

Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments