Submitted by WatchPug, also found by broccoli
When reserve == 0, amountIn for all the tokens will be set to the same amount: ratio, regardless of the weights, decimals and market prices of the assets.
The first liquidity provider may not be aware of this so that it may create an arbitrage opportunity for flashbots to take a significant portion of the value of The first liquidity providers liquidity.
IndexPool.sol#L93 L105
Given:
A significant portion (>90% in the case above) of the users funds can be lost due to arbitrage.
Consider allowing the first liquidity provider to use custom amountIn values for each token or always takes the MIN_BALANCE of each token.
