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. 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! [link] [comments] |
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