Event time not sequential in Diff. Depth Stream

Hi!

I’ve noticed that there are cases when two consecutive updates A and B from depth@100ms have incorrect event time: event A has E greater than event B. U and u fields are correct and as expected.

Is this normal? What is the exact meaning of “event time”? Am I wrong to interpret it as monotonically increasing server time?

The reception of those updates on the client side is not guaranteed to be in order, specially during high trade times. Please use the E (Event time - timestamp of when the service created the json payload) to order the updates locally.

I think this should be explained in the API doc about how to maintain a local order book :

How to manage a local order book correctly

I am often faced with inconsistent update ids regarding the rules stated in the link above, and I think this may be related to this fact. I will investigate more on this later and come back if I have more to tell.

This is an important precision… the local order book is corrupted if this rule is not taken into account.

Thanks! I will sort some events at my end, but my real concern is with diff. depth updates. There are cases when update ids are consistent, but server times are not (event B having correct U and u fields, but server time less than event A). So if I sort depth updates by server time, I will lose the update ids consistency.

@Mathias Actually, I’ve never experienced inconsistent update ids providing there are no websocket issues. Anyway, you should adapt your code to always request full depth snapshot whenever you get unexpected update ids. This approach works perfectly for me.