<!-- canonical: https://0xsimao.com/findings/more-markets-considered-deposit-calculations-deposits -->

# Vault cap is not considered in the maxDeposit() calculations, which may make deposits fail

Medium · Three Sigma · Lending · 2nd December 2024

Finding 3S-MORE-M01 of the MORE Optimizer security review.

- Protocol: https://www.more.markets/
- Report: /reports/more-optimizer
- Source: https://github.com/0xsimao/audits/blob/main/Three%20Sigma/2024-12-02-more-markets.pdf

---

### Description

LoopStrategy::maxDeposit() does not consider the vault cap, which limits the amount
that can be deposited if the utilization rate is close to the targetUtilization. Hence,
deposits will revert.

### Recommendation

Consider incorporating the maxDeposit() of the vault.

### Status

Addressed in [#4793c1c](https://github.com/MoreLabsXYZ/MORE-Optimizers/commit/4793c1c0addd19b463bcd5d14e9bb5ef4baae956).

Disclosed by 0xSimao (https://0xsimao.com/).

---

Related findings:

- [AaveYieldBackend.deposit() DoS when Aave pool is paused, frozen, or at supply cap](https://0xsimao.com/findings/superfluid-aave-yield-deposit-paused): Superfluid Yield Backends
- [Withdrawals can fail due to deposits reverting in `completeQueuedWithdrawal()`](https://0xsimao.com/findings/renzo-withdrawals-deposits-complete-withdrawal): Renzo
- [`PreDepositVault::maxDeposit/Mint()` are missing `maxDepositLimit` as per the ERC4626 spec](https://0xsimao.com/findings/gaib-deposit-mint-erc4626-spec): GAIB Pre-Vaults
- [`maxDeposit` doesn't comply with ERC-4626](https://0xsimao.com/findings/pooltogether-the-prize-layer-for-defi-deposit-comply-erc-4626): PoolTogether Prize Layer
