Liquidation Process
Overview of how liquidations are handled
Last updated
Overview of how liquidations are handled
Last updated
Blendy implements a Dutch auction liquidation mechanism that ensures fair price discovery while maintaining protocol solvency. The system processes liquidations through a two-phase approach: liquidation triggering and auction execution.
A CDP position becomes eligible for liquidation when its collateral-to-debt ratio falls below the liquidation threshold:
The protocol calculates liquidation amounts using proportional scaling:
The auction price follows a linear decay function:
where:
T = Auction duration
t = Time elapsed since auction start
The protocol initializes the Dutch auction with strict parameter validation:
The auction price updates in discrete steps to optimize gas efficiency:
Consider a position with:
When BONK price drops to $0.00011, the position's collateral ratio becomes:
Since 110% < 150% (liquidation threshold), the position becomes eligible for liquidation.
Liquidation Debt:
Since total_debt (100 USDC) > liquidation_boundary, liquidation debt = 100 × 50% = 50 USDC Liquidation Collateral is also proportional to debt: 1,000,000 × (50/100) = 500,000 BONK
Penalty: 50 USDC × 10% = 5 USDC
Total Debt with Penalty: 50 USDC + 5 USDC = 55 USDC
Liquidation Price:
$0.00011 per BONK
Start Price (90% of liquidation price):
$0.00011 × 90% = $0.000099 per BONK
3. End Price (minimum price to cover debt + penalty):
The auction will start at $0.000099 per BONK and decrease linearly to $0.00011 per BONK over the auction duration.
A liquidator buying at start price would pay:
For 500,000 BONK at $0.000099 = 49.5 USDC
Potential profit: 55 USDC (debt+penalty) - 49.5 USDC = 5.5 USDC
This creates an arbitrage opportunity while ensuring the protocol recovers the debt plus penalty.
All price and amount calculations use fixed-point arithmetic with appropriate scaling factors to prevent precision loss. Critical calculations include various over/underflow checks.
The protocol enforces maximum price age and requires valid price feeds before liquidation. This implementation ensures deterministic execution while maintaining economic security through carefully structured incentives and precise mathematical calculations.