1

I am forking uniswap and deploying it on Rinkbey TestNet.

I have successfully deployed factory, router, weth contracts. I have replaced the respective addresses in the uniswap interface code.

I created few new tokens for testing these: Token1 : KO1

Coming to interface (locally hosted), I am able to add liquidity and the interface is interracting with the deployed contracts.

I added liquidity as 5 ETH per 1 KO1.

But when I come to swap, and try to swap, it shows 'Insuffienct liquidity'.

What to do? What I am missing ??

Contracts deployed from address : 0x23c1f1d5cd74331d17d3952ec81edc6f331f942e

1
  • Have you found a solution?
    – Eusthace
    Commented Sep 11, 2021 at 19:47

1 Answer 1

1

These amount*Minparameters should typically be set to percentages of the calculated desired price. So, at a 1% tolerance level, if our user sends a transaction with 1 ETH and 200 DAI, amountETHMin should be set to e.g. .99 ETH, and amountTokenMin should be set to 198 DAI. This means that, at worst, liquidity will be added at a rate between 198 DAI/1 ETH and 202.02 DAI/1 ETH (200 DAI/.99 ETH).

Once the price calculations have been made, it's important to ensure that your contract a) controls at least as many tokens/ETH as were passed as amount*Desired parameters, and b) has granted approval to the router to withdraw this many tokens.

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.