In the SPOT depth WS API, each new message has several updates. The first update ID of a message is “U” field and the last update ID is “u”. field Each new message has to have its U equal to last message u + 1. This makes sense because, otherwise, an update occurred in between and we didn’t catch it : the order book integrity is compromised.
The Future depth WS API is slightly different. The documentation introduce another field “pu” which corresponds to “Final update Id in last stream(ie u
in last stream)”. What I understand is : 'Final update ID of the last “message” sent over this stream (correct me if I’m wrong).
What I don’t understand in this API is that, having tried it, many updates occured between last message and new message because new message ‘U’ is not equal to ‘u’ + 1, but ‘u’ + something > 1.
The documentation says that I only need to ensure that new message ‘pu’ equals to last message ‘u’. Then the question is : why don’t we need to verify, like in SPOT api, that new message U = last message u + 1? What is the purpose of this “pu” ? How to keep order book integrity while it seems that many updates occur between 2 consecutive messages?