The _depositLiquidity
function handles the deposit of liquidity into multiple strategies. It attempts to deposit liquidity into strategies one by one, moving to the next strategy if the current one is full. However, there is a critical issue: leftover liquidity can remain in the contract if not all liquidity is successfully deposited across the strategies. This leftover liquidity issue arises when the contract does not fully utilize the available liquidity, leaving tokens idle in the contract instead of being invested in strategies.
The main problem is that no check is made after the loop to ensure all tokens were deposited into strategies. This could lead to liquidity being left in the contract without being deployed as intended, causing inefficiencies in fund utilization and lower yields for users.
Example:
If 100 tokens are available for deposit, and Strategy A can only accept 50, the remaining 50 tokens may stay in the contract if subsequent strategies cannot accept the rest. This results in idle liquidity that is not used effectively.
** Idle Liquidity**: Any leftover tokens remain in the contract, preventing them from being utilized in strategies, which reduces the overall efficiency of the system and potential yield.
Lost Revenue: Users may lose potential revenue from these unutilized tokens since the system does not fully invest them.
Unexpected Contract Behavior: Users expect the contract to use the entire deposit. The fact that some tokens remain in the contract could lead to confusion and frustration for users.
The leftover liquidity issue in the _depositLiquidity function can cause inefficiencies by leaving some tokens idle in the contract. By adding a check after the loop and handling the leftover liquidity, this issue can be resolved, ensuring that all tokens are either deposited or the transaction fails gracefully. This will lead to more efficient fund utilization and greater transparency for users.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.