Submitted by shw
The withdrawSingleByLiquidity function of LifeGuard3Pool calls buoy.singleStableToUsd to calculate the return USD amount, which internally calls _stableToUsd with the deposit parameter set to true. A more accurate calculation is to set the deposit parameter to false since this action is a withdrawal. A similar issue exists in the function calcProtocolWithdraw of Allocation, where the current strategys USD is calculated by buoy.singleStableToUsd. See LifeGuard3Pool.sol #L226, Buoy3Pool.sol #L122, and Allocation.sol #L142.
Recommend considering adding a new boolean parameter, deposit, to the singleStableToUsd function of Buoy3Pool to indicate whether the action is a deposit or not, as that in the stableToUsd and stableToLp functions.
- kristian-gro (Gro) confirmed
