Liquidation System
The Liquidation System component handles the liquidation of unhealthy positions.
Action
Description
Function
Liquidate Position
Liquidate an unhealthy position
liquidation(address provider, address debtor, uint256 assetAmount)
Check Liquidation Status
Check if position is liquidatable
getLiquidateableAmount(address user)
Example: Check and Liquidate Position
// Check if a position is liquidatable
uint256 liquidateableAmount = IVault(vaultAddress).getLiquidateableAmount(userAddress);
// If liquidateable, execute liquidation
if (liquidateableAmount > 0) {
IVault(vaultAddress).liquidation(
liquidatorAddress, // Provider of nUSD for liquidation
userAddress, // Debtor whose position is being liquidated
liquidateableAmount // Amount of collateral to liquidate
);
}Last updated