Level2 order data missing data

24 views Asked by At

When using a websocket to capture level2 data from Coinbase, I'm receiving the price points and storing them in an array. My python program is successfully updating the coins at the appropriate price points, adding in new price points and removing price points that now have an order size of zero.

So I'm close to having a good representation of the order book, except...

I've noticed that when my script starts collecting the data, the lowest price in the sell orders drops to the lowest spot in my array. So a good start. However, as the price rises, those orders with lower values do not drop off the array.

Suspecting my coding was the problem, I stored all of the incoming data and I was surprised to find that the orders are never updated. Some are, but not all of them. It's like there are sell orders for below the market price that never sold, which makes no sense since obviously there are many buyers who would love to purchase at below the current market price!

So I have a price point of $66,000 in my order book and the price gradually rises to $66,500, but I still have an order for $66,000 because Coinbase never sent me an update that the size of the $66,000 price point is now zero.

Is this normal, somehow? Am I supposed to track the ticker price and remove all sell orders below the current market price or something? I would think that the level2 updates would keep the order book, you know, updated...

0

There are 0 answers