# IndexPool.mint The first liquidity provider is forced to supply assets in the same amount, which may cause a significant amount of fund loss

IndexPool.mint sets equal amountIn for all tokens when reserve is zero, ignoring weights/decimals, letting an attacker arbitrage away >90% of first LP's funds.

- Payout: Audit contest
- Severity: high
- Program: Sushi
- Found by: WatchPug
- Disclosed: 2021-11-22
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2021-09-sushitrident-findings/issues/72
- Library page: https://bugbountylibrary.com/r/c4%3A2021-09-sushitrident%3AH-07
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** IndexPool.mint in Sushi Trident contracts
**Root cause:** When reserve==0, amountIn is set to ratio for every token regardless of token weights, decimals, or market price, so the first LP's deposit is mispriced relative to the pool's intended composition.
**Steps:**
1. Deploy IndexPool weighted 99% USDT / 1% WBTC.
2. Alice (first LP) transfers 1e18 WBTC and 1e18 USDT to mint 100e18 liquidity; mint sets amountIn=ratio for both tokens since reserves are 0.
3. Bob swaps 100e18 USDT (~$100) through the pool to drain most of the WBTC balance.
4. Bob arbitrages the mispriced WBTC out for profit, taking >90% of Alice's value.
**How found:** Code reading of mint(): noticed the reserve==0 branch assigns amountIn = ratio uniformly across all tokens, ignoring per-token weights and decimals, then reasoned about the resulting mispricing for the first depositor.
**Exploitation:** Attacker waits for the first LP to initialize the pool, then swaps cheap USDT into the pool to extract the over-supplied WBTC at a favorable price, capturing the value the first LP deposited at equal nominal amounts.
**Insight:** In weighted/index pools, audit the first-deposit initialization path: any branch that treats all tokens symmetrically (equal nominal amounts) instead of respecting weights/decimals creates instant arbitrage against the initializer.

