Submitted by bin2chen, also found by oakcobalt (1, 2) and SpicyMeatball (1, 2)
Code reference: IsolateLogic.sol#L499
When executeIsolateLiquidate() is executed, it will account totalBidAmout/availableLiquidity.
The main accounting code is as follows:
We know from the above code that the current formula is as follows:
Both of these accounting errors. TotalExtraAmount is calculated twice.totalBorrowAmount already contains totalExtraAmount.
Example:
Suppose: total Borrow Amount = 100 , Actual Bid Amout = 80
So: total Extra Amount = 20
but in the current algorithm:
The correct value is:
thorseldon (BendDAO) confirmed and commented:
