Submitted by bin2chen, also found by Angry_Mustache_Man, dirk_y, and Giorgio
_computeAvailable() incorrect calculations that result in a return value greater than the current balance, causing methods such as liquidate to fail.
VaultBooster._computeAvailable() used to count the number of tokens currently available.
There are two conditions:
The code is as follows:
The current implementation code, limiting the maximum value of deltaAmount is wrong, using the minimum value compared to the current balance _tokenOut.balanceOf(address(this)).
But the current balance includes the previously accumulated boost.available, so normally it should be compared to the difference between the current balance and boost.available.
So the value returned may be larger than the current balance, and LiquidationPair.sol performs source.liquidatableBalanceOf() and source.liquidate() with too large a number, resulting in a failed transfer.
The maximum value returned should not exceed the current balance
Context
asselstine (PoolTogether) confirmed
