-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Handle
cmichel
Vulnerability details
The LongShort._handleTotalPaymentTokenValueChangeForMarketWithYieldManager function assumes that the YieldManager indeed withdraws all of the desired payment tokens, but it could be that they are currently lent out at Aave.
// NB there will be issues here if not enough liquidity exists to withdraw
// Boolean should be returned from yield manager and think how to appropriately handle this
IYieldManager(yieldManagers[marketIndex]).removePaymentTokenFromMarket(
uint256(-totalPaymentTokenValueChangeForMarket)
);Trying to withdraw these tokens will then fail.
Recommended Mitigation Steps
Boolean should be returned from yield manager and think how to appropriately handle this 😁