Uniswap / v1-contracts

🐍Uniswap V1 smart contracts
GNU General Public License v3.0
495 stars 318 forks source link

How important is the `min_liquidity` argument when adding liquidity #34

Closed PhABC closed 4 years ago

PhABC commented 5 years ago

Not an issue per say, but wanted to discuss the usefulness of the min_liquidity argument passed in the addLiquidity() function. It seems to me that other than obtaining less % of the liquidity pool than expected, there isn't really much that can happen as the user can always withdraw the tokens they deposited. It also seems to be mainly a concern with newly created pools where the liquidity can change abruptly.

Any potential attacks I am not seeing that the min_liquidity argument protect against? I see why the max_token is important as you might not want all your funds to be deposited if you also do something else with these tokens, but fail to see the practical relevance of the min_liquidity().