DueDEX used a partial liquidation process. By reducing the risk limit, maintenance margin will be reduced to prevent full liquidation.
For users using the lowest risk limit
All active orders will be canceled. If the maintenance margin requirement has not been met, the position will be taken over by the liquidation engine at the bankruptcy price.
For users using higher risk limits
The liquidation engine will take following steps to reduce the maintenance margin.
1. keeping the active orders and open positions, while reducing the user's risk limit.
2. Cancelling active orders, while keeping open positions, and reducing the risk limit.
3. A FillOrKill ( full execution or immediate cancellation) will be submitted, the value of which equals to the difference between the value of current open positions and the value of the lower risk limit that meets the margin requirement.
4. If the position still needs to be liquidated, the entire position will be taken over by the liquidation engine at its bankrupt price.
System Profit and Loss
If DueDEX can close a position at a price better than the bankruptcy price, then additional funds will be added to the Insurance Fund.
If DueDEX cannot close the position at the bankruptcy price, DueDEX will spend the insurance fund to meet the gap. If the Insurance fund fails to cover the loss, it will lead to the Auto-Deleveraging process.