# User deposits don't have min. return checks

LPIssuer.deposit lacks min-return check; strategist rebalancing frontruns user deposits, silently changing balanced token mix and minted LP share.

- Payout: Audit contest
- Severity: medium
- Program: Mellow Protocol
- Found by: cmichel
- Disclosed: 2022-02-09
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2021-12-mellow-findings/issues/46
- Library page: https://bugbountylibrary.com/r/c4%3A2021-12-mellow%3AM-01
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:solidity technique:chained vuln:business-logic

**Target:** LPIssuer.deposit vault LP minting
**Root cause:** deposit computes balancedAmounts from current vault tvl ratios without a user-specified minimum LP output, so a strategist rebalance between submission and execution changes the effective token mix and minted shares.
**Steps:**
1. Vault holds tokens A,B with tvls `[500,1500]`; user submits `tokenAmounts=[500,1500]` expecting 50% of supply.
2. Strategist rebalances vault to `[1000,1000]` before user tx lands.
3. deposit computes balanceFactor `min(500/1000,1500/1000)=1/2`, balancedAmounts `[500,500]`, refunds 1000 excess B.
4. User receives `500/(1000+500)=33.3%` of supply instead of expected 50%, consuming all token A.
**How found:** Code review of deposit's balancedAmounts logic: noticed ratio depends on mutable vault tvl, hypothesized strategist rebalance between user submission and execution changes outcome.
**Exploitation:** Strategist (or anyone able to trigger rebalance) frontruns the deposit tx to shift vault tvl ratios, forcing the user's deposit into an unintended token mix and lower LP share; no direct theft described, user suffers unfavorable trade.
**Insight:** In vault/LP designs where deposit sizing derives from live tvl ratios, check whether an actor who can move tvl (strategist rebalance, harvest, keeper) can sandwich user deposits; missing slippage params on minted shares are the tell.
