Submitted by 0xTheC0der
Unhealthy troves with ltv > 90% and threshold < 90% cannot always be absorbed due to a wrong if-condition. According to Priority of liquidation methods it should always be possible to absorb unhealthy troves with ltv > 90%:
However, the purger::get_absorption_penalty_internal() method mistakenly checks the threshold instead of the ltv against the ABSORPTION_THRESHOLD (90%) in L467:
As a consequence, unhealthy troves can only be absorbed if they reach the maximum possible penalty although the condition ltv > 90% is already satisfied. This is against the protocols intended liquidation/absorption incentives and therefore, endangers the solvency of the protocol.
By observing the sponsors graph for liquidation penalty it becomes evident that the MAX_PENALTY can only be achieved for ltv up to 89%. For even higher ltv up to 100%, the penalty approaches 0% due to max_possible_penalty (see code above), which lowers the incentives for liquidation and makes absorption a necessity.
In case of threshold > 83% there is a window where 90% < ltv < ltv@max_possible_penalty causing absorptions to be impossible due to the present bug. This linked graph visualizes the present issue.
In the following, a numerical example is provided to demonstrate the above claims. Initial assumptions:
Lets do the math step-by-step:
We can see that the trove has not reached its maximum possible penalty yet, therefore, it cannot be absorbed as expected, although ltv > 90%.
Make sure the absorption threshold is checked against the ltv as intended:
Math
0xsomeone (judge) commented:
tserg (Opus) commented:
0xsomeone (judge) commented:
0xTheC0der (warden) commented:
tserg (Opus) commented:
milancermak (Opus) confirmed
For this audit, 5 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by 0xTheC0der received the top score from the judge.
The following wardens also submitted reports: hals, lsaudit, bin2chen, and Kaysoft.
