Liquidation
Last updated
Last updated
In the Centuari protocol, the liquidation mechanism serves as a risk management tool to maintain the health of the lending system. It allows third-party liquidators to close borrower positions under specific conditions:
The loan has passed its maturity date, or
The borrower's position has fallen below the required health factor.
Liquidators repay the borrower’s outstanding debt and, in return, receive the borrower’s collateral as compensation.
The liquidate()
function handles the liquidation process through the following steps:
Before proceeding, the function validates:
That the borrower’s address is not zero.
That the borrower’s position is eligible for liquidation:
The maturity date has passed (if a maturity is set), or
The borrower's health factor is below the allowed threshold.
Example:
The protocol retrieves the borrower’s current position data from the corresponding DataStore
contract based on the market configuration:
Example:
Since Centuari employs share-based accounting (similar to ERC-4626 vault mechanisms), the borrower’s debt is computed proportionally based on their borrow shares relative to the total borrow shares.
Example:
Once the borrower’s debt is determined:
The system subtracts the borrower’s shares and corresponding assets from the total pool.
The borrower’s loan shares and collateral positions are reset to zero.
The liquidation involves two on-chain asset transfers:
The liquidator transfers loan tokens (e.g., USDC) equivalent to the borrower’s debt to the protocol.
The liquidator receives the borrower’s collateral (e.g., WBTC) in return.
Example:
The contract emits an event to log the liquidation for transparency, analytics, and indexing by off-chain services (e.g. The Graph, Etherscan).
Example:
Assumptions:
Borrower A has taken a loan of 500 USDC, using 1 WBTC as collateral.
Borrower A holds 5 borrow shares out of 50 total shares in the pool.
Total outstanding debt in the pool is 5000 USDC.
Debt Calculation:
Liquidation Process:
The liquidator transfers 500 USDC to the contract.
The liquidator receives 1 WBTC as collateral.
✅ Open Liquidation System: Anyone can act as a liquidator and claim collateral from unhealthy positions. ✅ Share-Based Accounting: Scalable and dynamic, ensuring fair debt and collateral calculations. ✅ Event Logging: Transparent on-chain event emission enables robust tracking and off-chain integrations. ✅ Market-Specific Configurations: Liquidation eligibility and parameters are determined per-market basis.
The Centuari protocol’s liquidation mechanism is designed to:
Secure the protocol against bad debt
Maintain lending pool health
Reward third-party liquidators
Protect the interests of other lenders in the pool
It operates through a secure, event-driven, share-based system that balances flexibility and protocol integrity.
Contract related: ,