Orderbook (l2 data from websocket) looking weird


I’m currently rebuilding the order book using the l2 data channel and I have noticed that the bids and offers are not passing one of our validations, which is the first bid should not be greater than the first offer. Initially, I thought this was some transitory state and in the next message on the websocket it should be resolved. But through some tests I noticed that sometimes this keeps being true for more than 20 seconds, which I thought it was really weird.

I am connected to multiple exchanges and I don’t see this behavior, is it to be expected? Is there anything I am missing?

This log below is from BTC/USD

INFO:root:bid > ask05/08/2023, 16:11:33

INFO:root:bid > ask fixed05/08/2023, 16:11:51

Can you guys help me to clarify this?

Thanks in advance,

1 Like