Trading
Liquidation
When the engine closes an account, and the insurance fund.
The engine liquidates an account when its equity falls below the sum of its positions' maintenance margin. Equity here is collateral plus unrealized PnL at the mark price, across every market. The engine then cancels the account's open orders and closes every position it holds with market orders, each against its own book.
Liquidation price
Each open position shows a liquidation price: the mark at which the account's equity would reach its maintenance margin, with everything else held where it is now. Because margin is cross, the price moves when your other positions gain or lose, or when collateral comes in or goes out. A position with no such price shows none.
The liquidation fee
The engine charges 0.25% of the closed notional and pays it to the insurance fund.
What a liquidation records
The closing orders fill like any other order, and each of their fills is marked as a liquidation fill. What is left of the account's equity after the realized loss and the fee stays in the account. The account also gets a liquidation record with the market, side, size, price, realized PnL and fee.
The insurance fund
The insurance fund holds liquidation fees and funding rounding. When a liquidation leaves an account below zero equity, the fund covers the shortfall, and the traders on the other side of the closing fills are paid in full.