Liquidation Mechanism

A liquidation mechanism is the process by which a lending protocol closes undercollateralized positions by selling collateral to repay debt, maintaining overall protocol solvency.

In Depth

Liquidation mechanisms are a core safety feature of DeFi lending protocols. When a borrower's collateral value drops below a required threshold (the health factor falls below 1), liquidators can repay a portion of the debt and seize the borrower's collateral at a discount (the liquidation bonus). This incentivizes timely liquidation and protects the protocol from accumulating bad debt. However, cascading liquidations — where one liquidation triggers further price drops causing more liquidations — can destabilize markets. Invariant testing is critical for verifying liquidation correctness: properties like 'the protocol never accumulates bad debt,' 'liquidation only occurs when health factor is below threshold,' and 'liquidation bonus is always applied correctly' can be checked across millions of scenarios.

Frequently Asked Questions

How does liquidation work in DeFi lending?

When a borrower's collateral value drops below the required ratio (health factor below 1), anyone can act as a liquidator by repaying part of the borrower's debt and receiving the equivalent collateral plus a bonus (typically 5-10%). This keeps the protocol solvent by ensuring all loans remain adequately collateralized.

What are cascading liquidations?

Cascading liquidations occur when the collateral sold during liquidation pushes asset prices down further, causing more positions to become undercollateralized and triggering additional liquidations. This feedback loop can cause rapid market crashes and was a factor in several DeFi crises.

How can invariant testing verify liquidation correctness?

Invariant testing can assert properties like 'no bad debt accumulates,' 'only undercollateralized positions are liquidatable,' and 'liquidation bonus is correctly calculated.' Fuzzers then test these across millions of random price movements, borrow/repay sequences, and liquidation attempts to find edge cases.

Related Terms

Need expert help with liquidation mechanism?