Further Information about the Liquidation Process
Users on the Lowest Risk Limit tiers
- If a trader is on the lowest Risk Limit tier then upon liquidation BitMEX will first cancel any open orders in the contract.
- If this increases the Available Balance such that the maintenance margin requirement is satisfied then no liquidation will occur.
- However if this requirement is not satisfied, the liquidation process continues whereby the liquidation engine takes over the position including any remaining maintenance margin, and then attempts to liquidate the position with a Limit order at the bankruptcy price.
Users on Higher Risk Limit tiers
- If a trader is on a higher Risk Limit then the liquidation process is slightly different. Firstly, if the sum of the open orders and the current position is below the current Risk Limit then the Risk Limit is reduced to the associated summed position tier, along with the reduced maintenance margin requirement. If the current margin satisfies the reduced maintenance margin requirement, then the liquidation process is stopped.
- If the position is still in liquidation then any open orders for that contract are cancelled, and the engine checks if it can reduce the Risk Limit based now on the current open position value and then follows the same process as in the first step.
- If the position is still in liquidation, then a FillOrKill order, of a size to bring the position value below a lower tier Risk Limit and thus reduce the maintenance margin requirement, is submitted on behalf of the user.
- If either the FillOrKill order is not executed, or after a successful execution the position is still in liquidation, then the entire position is taken over by the system with a limit order placed at the bankruptcy price.
Liquidation Example
A trader goes long 1 contract at $100.00, with a liquidation price of $99.50 and a bankruptcy price of $99.00. The trader is liquidated and the trading engine places a limit sell order with a limit price of $99.00 (the bankruptcy price). The liquidation order is filled at $99.25. The Insurance Fund now has $0.25.
Another trader goes long 1 contract at $100 with a liquidation price of $99.5 and a bankruptcy price of $99.00. The trader is liquidated and the trading engine places a limit sell order with a limit price of $98.75. This is calculated from a bankruptcy price of $99.00 minus a contribution from the insurance fund of $0.25. The trading engine uses the available insurance funds to submit an order with a more aggressive limit price. The liquidation order is filled at $98.75. The insurance fund now has $0 and ADL has been avoided.
API Data
For an example of how this process looks via the API, please see the WebSocket Documentation