I am unable to parse the market-depth data properly.
According to the documentation: 1) Market depth consists of 10 entries - first 5 are bid entries and and the next 5 are offer entries 2) The structure of each market depth entry is as follows: - quantity (4 bytes) - price (4 bytes) - orders (2 bytes)
Looks like the first 2 fields - quantity and price are documented correctly. But there is some issue with the "orders" field. Either it is occupying more than 2 bytes or there is a gap of 2 bytes between 2 consecutive market-depth entries. Or maybe there is some other issue.
Your assumption is correct. There is a 2 bytes padding after orders field. You can either ignore this or use a packet splitting mechanism instead of a stream read. For each tick, we are sending the length of the packet and you can use this length to split it. You can check the python example here.
Regarding length of packet, all the market depth entries are part of the same packet. So, It is not directly possible to figure out the "2 byte-padding" between market-depth entries from the packet length. All I can figure out is that there is a mismatch between the packet length and the total amount of data in the packet. But there is no way to tell where the extra bytes present in the packet would be used.
Would it be possible for you to get the documentation updated regarding this?
Your assumption is correct. There is a 2 bytes padding after orders field. You can either ignore this or use a packet splitting mechanism instead of a stream read. For each tick, we are sending the length of the packet and you can use this length to split it. You can check the python example here.
Regarding length of packet, all the market depth entries are part of the same packet. So, It is not directly possible to figure out the "2 byte-padding" between market-depth entries from the packet length. All I can figure out is that there is a mismatch between the packet length and the total amount of data in the packet. But there is no way to tell where the extra bytes present in the packet would be used.
Would it be possible for you to get the documentation updated regarding this?
We will inform the respective team regarding this. Thanks for pointing out.
We have updated the documentation.