I have a project where users can buy items with various ERC20 tokens but I want to provide an exchange for them so that they don't have to go to the other site and exchange them. So lets say that ITEM A costs x amount of TOKEN A but the buyer only has TOKEN B. What I want to do is let the buyer buy items in any currency but for a given exchange rate.

Is that possible to do with Uniswap and how would I integrate Uniswap into my smart contract that currently does just a simple transfer from one account to another. I've gone through bunch of tutorials but none of them show how to properly integrate Uniswap.

1 Answer 1


Uniswap can do that, but only if token B is liquidity.

Integrating Uniswap is simple, and there are many things you can do using the Route contract, such as swap and add liquidity.

Another option is to deploy a set of Uniswap yourself, which can be cumbersome.

  • Do you maybe have some projects for reference. I am not entirely sure how would I integrate it. And regarding the liquidity, what if that token is already in the liquidity pool? Would I still need to provide the liquidity? Commented Aug 9, 2021 at 11:21
  • If you already have liquidity, you don't have to provide liquidity,
    – zmy
    Commented Aug 10, 2021 at 1:18
  • You should go to the Uniswap documentation, it goes into great detail
    – zmy
    Commented Aug 10, 2021 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.