msgs.zipPlease can you assist with the following questions regarding message types add/delete/update. A sample of the script and output are enclosed for your reference.
Our goal is to track bids/asks in according maps see: "def process_message(message_json):". We encounter a lot of situations with double DELETES etc. The full data from one of our runs is enclosed, as well as grepped messages for only the "MTQ6NDA1MS8x" key, to illustrate.
You can run the script yourself if needed.
Service: Refinitiv Real-Time Optimised
Instrument: ESH3 (EMINI S&P MAR3)
We get DELETES and UPDATES for levels that we did not receive before, and sometimes ADDS for levels that already existed. The most frequent occurrence is to receive a DELETE message before an ADD.
Can you please advise how we should interpret and handle the following scenarios:
1. We receive DELETE before ADD
2. We receive UPDATES for price levels of which we did not receive an ADD; and ADD messages for price levels that already existed
3. We receive and ADD and DELETE in one message. It is unclear which happened first (no sequence number of timestamp provided)
We are not receiving a “Complete” message flag while documentation suggests we should.
In this article: https://developers.refinitiv.com/en/article-catalog/article/consuming-order-book-level-2-data-with-elektron-websocket-api it says that at first we get a L2 orderbook snapshot and then a "Complete" flag in message points it's end. We have never seen this "Complete" flag in any message.
We have a 12:399575/1 string after decoding "Key" from base64. What does it mean? 399575 obviously a price in integer, 1/2 BID/ASK but what is “12”? Also consuming-order-book-level-2-data tutorial says encoded format is like 128.56A. Quote: "Convert the Key into string format e.g. '128.56A'"
Examples (further details in the msgs.zip with json file inside):
MTI6Mzk5NTc1LzE= base64: 12:399575/1
ADD/DEL/DEL+ADD in one
MTI6Mzk5ODI1LzI= base64: 12:399825/2
MTQ6Mzk5My8x base64: 14:3993/1
DEL+ADD in one
MTQ6Mzk5OC8y base64: 14:3998/2
DEL+ADD in one
MTM6Mzk5NTUvMQ== base64: 13:39955/1