0

I am reconstructing the limit order book on Binance. I get a snapshot at a particular time and update this snapshot based on the updates for each level that come every 100 ms from the exchange. Most of the time my reconstructed depth chart looks normal:

"Normal" depth chart

but at some points in time top bids start to exceed the lowest asks (which doesn't make sense to me). At those times, the depth chart starts to look like this:

"Strange" depth chart

Can somebody tell if the limit order book can sometimes look like in the second picture, or it is impossible (perhaps there is an error in how I reconstruct the LOB)?

2
  • Do you take into account volume of the orders? I don't know how Binance handles limit orders that cannot be fully executed, but if someone wants to buy 1 BTC at [value] and someone wants to sell 0.3 BTC at [lower value], is that trade processed and updated to 0.7 BTC? Or is it left on the market because buyer's transaction only processes when there's enough available at that price to fill their order in its entirety?
    – Joe
    Commented Feb 9, 2022 at 19:39
  • @Joe Each price level contains the absolute value of the total of all limit orders at that price level. So (unless i grossly misunderstand something here) yes, the volume is taken into account. HOWEVER, I do not know whether a level is updated every time an order is partially fulfilled, or when it is filled in its entirety. Logic suggests that if updates are sent every 100 ms (which is what the case is with the Binance API), these updates must reflect partially filled orders too. Commented Feb 10, 2022 at 0:36

0

You must log in to answer this question.

Browse other questions tagged .