Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 can pull in less than amountIn, can uni v2? #164

Open
NatPDeveloper opened this issue Jul 19, 2023 · 0 comments
Open

v3 can pull in less than amountIn, can uni v2? #164

NatPDeveloper opened this issue Jul 19, 2023 · 0 comments

Comments

@NatPDeveloper
Copy link

So it came to my attention recently that uni v3 can pull in less than the amount in specified for a swap if there's insufficient liquidity.

I'm curious if uniswap v2 can do this as well. It looks like no but it would be great to be sure as the scenario I mentioned above is not in the docs. https://github.com/Uniswap/v2-periphery/blob/master/contracts/libraries/UniswapV2Library.sol#L65

UniV3
https://github.com/Uniswap/v3-core/blob/d8b1c635c275d2a9450bd6a78f3fa2484fef73eb/contracts/UniswapV3Pool.sol#L563
https://github.com/Uniswap/v3-core/blob/main/contracts/UniswapV3Pool.sol#L767

I would suggest adding the above scenario to the docs for those developing smart contracts on top of the protocol this can lead to forever locked funds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant