Unstable Protocol
  • Introduction
  • Users
    • Mint nUSD
    • Repay nUSD
    • Interest and Fees
    • Collateralization and Liquidation
    • Redemption
  • Developers
    • Architecture
    • Position Management
    • Interest and Fees
    • Price Oracle
    • Liquidation System
    • Redemption System
    • Emergency Controls
    • Deployments
    • Security & Audits
Powered by GitBook
On this page
Export as PDF
  1. Developers

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
    );
}
PreviousPrice OracleNextRedemption System

Last updated 2 months ago