Skip to content

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

@NatPDeveloper

Description

@NatPDeveloper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions