There is no control for liquidity squeeze that is typical for lending markets and can routinely happen in Aave pools.
Withdrawals exceeding available funds will be reverted, which will block any strategy call's upstream functionality that now tries to withdraw what is needed based solely on the aToken balance and fails if this call reverts.
Vulnerability Detail
A part of lending pool funds is routinely temporary locked, being lent out. Withdrawal requests that exceed the amount of free funds available will be failed, even for big pools there is no guarantees that given amount can be withdrawn.
This way, as an example, a rebalancing that includes many strategies will fail when one of them have even small liquidity shortage.
Impact
Rebalancing will be frozen until Aave pool liquidity returns. Corresponding Aave pool cannot be manually removed from Vault allocation.
Code Snippet
AaveStrategy's _withdraw() fails when lendingPool.withdraw() reverts:
Lines of code
https://github.com/Tapioca-DAO/tapioca-yieldbox-strategies-audit/blob/05ba7108a83c66dada98bc5bc75cf18004f2a49b/contracts/aave/AaveStrategy.sol#L263-L267
Vulnerability details
Summary
There is no control for liquidity squeeze that is typical for lending markets and can routinely happen in Aave pools.
Withdrawals exceeding available funds will be reverted, which will block any strategy call's upstream functionality that now tries to withdraw what is needed based solely on the aToken balance and fails if this call reverts.
Vulnerability Detail
A part of lending pool funds is routinely temporary locked, being lent out. Withdrawal requests that exceed the amount of free funds available will be failed, even for big pools there is no guarantees that given amount can be withdrawn.
This way, as an example, a rebalancing that includes many strategies will fail when one of them have even small liquidity shortage.
Impact
Rebalancing will be frozen until Aave pool liquidity returns. Corresponding Aave pool cannot be manually removed from Vault allocation.
Code Snippet
AaveStrategy's
_withdraw()
fails whenlendingPool.withdraw()
reverts:https://github.com/Tapioca-DAO/tapioca-yieldbox-strategies-audit/blob/05ba7108a83c66dada98bc5bc75cf18004f2a49b/contracts/aave/AaveStrategy.sol#L263-L267
The
toWithdraw
is determined solely based on what is needed and the current strategy's aToken balance:While Aave v2 revert withdraw() calls when the amount is less than user balance, but exceeds the liquidity available:
https://github.com/aave/protocol-v2/blob/6f57232358af0fd41d9dcf9309d7a8c0b9aa3912/contracts/protocol/lendingpool/DefaultReserveInterestRateStrategy.sol#L132
https://github.com/aave/protocol-v2/blob/baeb455fad42d3160d571bd8d3a795948b72dd85/contracts/protocol/libraries/logic/ReserveLogic.sol#L233-L235
Tool used
Manual Review
Recommendation
Consider using try-catch approach for Aave withdrawal, for example:
Assessed type
Other