Section 13 of 15
TroveManager: Recovery Mode and CollSurplusPool
Key takeaway: Recovery Mode kicks in when the system-wide TCR drops below 150% (CCR). The liquidation rules change: Troves with ICR up to the current TCR become liquidatable, not just those below MCR. Liquidations in Recovery Mode use a three-branch logic based on the Trove's ICR — below 100% redistributes everything, 100% to 110% offsets and redistributes, 110% to TCR offsets with a capped collateral payout (only
1.1 × debt / priceof collateral goes to the Stability Pool; the rest is set aside as collateral surplus for the owner to claim). The CollSurplusPool contract holds this excess collateral on behalf of liquidated owners. Recovery Mode is the protocol's mechanism to restore solvency by aggressively but fairly unwinding the riskiest Troves.
What You Are Building
Four things:
_liquidateRecoveryMode(...)— the three-branch liquidation logic._getCappedOffsetVals(...)— the capped-offset calculation used in the highest branch._getTotalsFromLiquidateTrovesSequence_RecoveryMode(...)— the batch loop in Recovery Mode (different from Normal Mode because the system may "back to Normal" mid-loop).CollSurplusPool— the contract that holds excess collateral for owners to claim, plusBorrowerOperations.claimCollateral()to withdraw it.
Your Code
Requirements
Sign up free — keep reading + earn 15 Lynx
Zealynx Academy is free. Track your progress, earn Lynx, and climb the leaderboard.
Sign up free to continueAlready have an account? Log in