The Liquidation Engine in Stella Trade ensures the platform's solvency by liquidating under-collateralized accounts when their margin balance drops below the required maintenance margin. This process employs a Fill-or-Kill method, effectively unwinding positions using the JIT auction mechanism alongside existing order book liquidity.
Liquidation Workflow
Trigger Condition:
Liquidation is triggered when the margin balance of a user or market maker falls below the required maintenance margin.
Fill-or-Kill Execution:
All positions in the affected account are liquidated immediately. The system combines JIT liquidity and order book depth to ensure efficient execution.
Settlement:
The proceeds from the liquidation are used to cover the shortfall, with any remaining collateral returned to the user after deducting applicable fees.
Key Formulas
Wallet Balance: Represents the total value of tokens in a user’s allocated account: