Hi aisling,
Thanks for your reply! If I understand you correctly, I would then get a partial fill message for each price level that my order depletes from the order book. Let’s say that when my buy order of 91.2 XRPUSDT hits the exchange the actual order book volume at the lowest price of 1.3286 was 17.9. So I would get a partial fill message of quantity 17.9 @ price 1.3286. Then we go to the next price level @ 1.3287, where there is a volume of 30.4 - so I get the next partial fill of quantity 30.4 @ 1.3287 (=48.3 cumulative quantity).
In this case, I would expect that the last fill prices of the partial fill messages in the user data stream (the “L” field) have different prices - like in my hypothetical example above. However, in my real example, my partial fill messages all have the same price 1.3286 - only the last fill message has a different price 1.3288.
Please find the messages below.
Thank you, aisling.
New order
{"e":"ORDER_TRADE_UPDATE","T":1619096410202,"E":1619096410206,"o":{"s":"XRPUSDT","c":"7277","S":"BUY","o":"MARKET","f":"GTC","q":"91.2","p":"0","ap":"0","sp":"0","x":"NEW","X":"NEW","i":12814899461,"l":"0","z":"0","L":"0","T":1619096410202,"t":0,"b":"0","a":"0","m":false,"R":false,"wt":"CONTRACT_PRICE","ot":"MARKET","ps":"BOTH","cp":false,"rp":"0","pP":false,"si":0,"ss":0}}
Partial fill 1:
{"e":"ORDER_TRADE_UPDATE","T":1619096410202,"E":1619096410207,"o":{"s":"XRPUSDT","c":"7277","S":"BUY","o":"MARKET","f":"GTC","q":"91.2","p":"0","ap":"1.32860","sp":"0","x":"TRADE","X":"PARTIALLY_FILLED","i":12814899461,"l":"17.9","z":"17.9","L":"1.3286","n":"0.00001511","N":"BNB","T":1619096410202,"t":329482146,"b":"0","a":"0","m":false,"R":false,"wt":"CONTRACT_PRICE","ot":"MARKET","ps":"BOTH","cp":false,"rp":"-0.32602063","pP":false,"si":0,"ss":0}}
Partial fill 2
{"e":"ORDER_TRADE_UPDATE","T":1619096410202,"E":1619096410207,"o":{"s":"XRPUSDT","c":"7277","S":"BUY","o":"MARKET","f":"GTC","q":"91.2","p":"0","ap":"1.32860","sp":"0","x":"TRADE","X":"PARTIALLY_FILLED","i":12814899461,"l":"30.4","z":"48.3","L":"1.3286","n":"0.00002566","N":"BNB","T":1619096410202,"t":329482147,"b":"0","a":"0","m":false,"R":false,"wt":"CONTRACT_PRICE","ot":"MARKET","ps":"BOTH","cp":false,"rp":"-0.55368867","pP":false,"si":0,"ss":0}}
Partial fill 3:
{"e":"ORDER_TRADE_UPDATE","T":1619096410202,"E":1619096410207,"o":{"s":"XRPUSDT","c":"7277","S":"BUY","o":"MARKET","f":"GTC","q":"91.2","p":"0","ap":"1.32860","sp":"0","x":"TRADE","X":"PARTIALLY_FILLED","i":12814899461,"l":"5.3","z":"53.6","L":"1.3286","n":"0.00000447","N":"BNB","T":1619096410202,"t":329482148,"b":"0","a":"0","m":false,"R":false,"wt":"CONTRACT_PRICE","ot":"MARKET","ps":"BOTH","cp":false,"rp":"-0.09653124","pP":false,"si":0,"ss":0}}
Fill:
{"e":"ORDER_TRADE_UPDATE","T":1619096410202,"E":1619096410207,"o":{"s":"XRPUSDT","c":"7277","S":"BUY","o":"MARKET","f":"GTC","q":"91.2","p":"0","ap":"1.32868","sp":"0","x":"TRADE","X":"FILLED", "i":12814899461,"l":"37.6","z":"91.2","L":"1.3288","n":"0.00003175","N":"BNB","T":1619096410202,"t":329482149,"b":"0","a":"0","m":false,"R":false,"wt":"CONTRACT_PRICE","ot":"MARKET","ps":"BOTH","cp":false,"rp":"-0.68866277","pP":false,"si":0,"ss":0}}