Submitted by 0xA5DF, also found by cccz and Lambda
When theres bad debt which wasnt marked off yet, the totalAssets.amount is higher than the actual (solvent) amount the pair has, meaning that lenders who redeem their tokens earlier will get more in return, at the expense of lenders who leave later.
Therefore bad debt should be marked off as soon as possible, the later its done the more interest it accumulates and the higher the chances are that some of the lenders will notice and redeem their shares before the bad debt is subtracted from the total assets amount.
Having the option to liquidate via the liquidate() function (which doesnt mark off bad debt) can lead to users using that function and leaving bad debt alongside zero collateral or near-zero collateral (giving no motivation for other users to liquidate the rest).
Marking off the remaining of the bad debt via liquidateClean() with 0 shares might be possible (not always, some tokens dont allow 0 transfers), however theres no motivation for outside users to do so. And as for the lenders - redeeming their tokens before the bad debt is subtracted from the total amount might be more profitable than staying and marking off the bad debt.
Some lenders might be able to dodge the loss of the bad debt (+ interest), while the last one(s) will have to absorb the lost of the lenders who left too.
Consider the following scenario:
Mark off bad debt when remaining collateral reaches zero or near-zero value.
(if only liquidateClean() was available then there would be a motivation to not leave near-zero collateral, but as long as this isnt the case consider marking off also in case of near-zero collateral left).
DrakeEvans (Frax) confirmed
gititGoro (judge) commented:
