Liquidation is a process of selling collateral assets to payback outstanding Acala Dollar debt from an unsafe loan/vault. Liquidation ensures each Acala Dollar is always sufficiently backed by an excessive amount of collaterals by closing a loan position/vault as it becomes unsafe (its current ratio is less than the Liquidation Ratio).
Trigger Liquidation is automatically done on-chain: Acala stablecoin protocol implements an on-chain Liquidator (Keeper) that monitors all loan positions every block. If any vault/loan is deemed unsafe, it will trigger a liquidation of this particular loan
Target Liquidation Amount: the system calculates a target amount of Acala Dollar that needs to be recovered (Acala Dollar outstanding + Liquidation Penalty)
Sell Collateral on AcalaSwap first: the system will sell off collaterals in that loan on the AcalaSwap first if slippage is acceptable. Price assessment is done comparing price on the swap against Oracle price.
Sell Collateral via Collateral Auction: if the slippage on AcalaSwap is not acceptable, then the collateral will be sold on the collateral auction
Repay Debt: after collateral is sold, recouped Acala Dollar are used to payback outstanding debt, Liquidation Penalty are added to stablecoin Treasury, remaining unsold collaterals are returned to the loan owner. And the loan is now closed.
Unpaid Debt: in extreme market conditions, if collaterals cannot be sold (either via DeX or Auction) to repay debt and liquidation penalty, then the collateral will be collected by the CDP Treasury, while outstanding aUSD will be recorded as debt. These collaterals can be sold at a later time (managed by governance) to repay the outstanding aUSD.
Below are useful links regarding the Liquidation Process
more detail on the liquidation process and auction mechanism here
bid in the auction to purchase collateral assets that are potentially at discount here
create a liquidation auction bot to automatically arbitrage here