Liquidation Process
Overview of how liquidations are handled
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.
Core Liquidation Mathematics
Position Liquidation Threshold
A CDP position becomes eligible for liquidation when its collateral-to-debt ratio falls below the liquidation threshold:
Liquidation Amount Calculation
The protocol calculates liquidation amounts using proportional scaling:
Dutch Auction Price Mechanics
The auction price follows a linear decay function:
where:
T = Auction duration
t = Time elapsed since auction start
Implementation Details
Auction Initialization
The protocol initializes the Dutch auction with strict parameter validation:
Price Updates
The auction price updates in discrete steps to optimize gas efficiency:
Example Scenario
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
Dutch Auction Prices
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.
Liquidator Incentive
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.
Security Considerations
Numerical Precision
All price and amount calculations use fixed-point arithmetic with appropriate scaling factors to prevent precision loss. Critical calculations include various over/underflow checks.
Oracle Safety
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.
Last updated