I’m trying to reconstruct historical liquidations and have therefore downloaded historical liquidation snapshots for the coin-margined futures market with the BTCUSD_PERP pair from Binance’s historical data.
Here is what this data looks like:
I have a few questions that I couldn’t find answers to anywhere else:
- My first question is why every liquidation order seems to be duplicated. It appears that each order is simply included twice in the CSV file. Do I need to delete one of these identical lines to get the correct data?
- The meaning of the attributes:
original_quantity
,last_fill_quantity
,accumulated_fill_quantity
. These are liquidation orders, which means the orders are executed directly and fully. So why is there a distinction betweenoriginal_quantity
(the number of contracts that need to be sold/bought) andaccumulated_fill_quantity
(the number of contracts that have been sold/bought)? I would have thought that these two values must necessarily be the same, and so far, I haven’t found any discrepancies between these values. When an order is created, it is often filled by several smaller orders. Does the attributelast_fill_quantity
indicate the volume of the last smaller order that filled the original order? That is, iflast_fill_quantity == accumulated_fill_quantity
, does that mean that the liquidation order was filled in one go and did not require multiple smaller orders? - The meaning of the attributes:
price
,average_price
. I’ve noticed that if it’s a SELL order, thenaverage_price > price
, and if it’s a BUY order, thenaverage_price < price
. Does this mean thatprice
is the rate calculated by Binance at which the order must be forcefully closed to prevent the account from going negative? And therefore, the liquidation is always executed slightly earlier at theaverage_price
to ensure the account does not go negative due to slippage or other factors?