Nethereum.Uniswap-V2-and-V3 icon indicating copy to clipboard operation
Nethereum.Uniswap-V2-and-V3 copied to clipboard

Is there any examples about swap other token for eth

Open Eternity714 opened this issue 2 years ago • 5 comments

Dear sir, I want to swap other token (i.e usdt or dai) for eth, but I can't find any example in this repo, can you provide some support。

(please forgive my bad english and writing format)

Eternity714 avatar Sep 16 '22 04:09 Eternity714

https://github.com/Nethereum/Nethereum.Uniswap-V2-and-V3/blob/main/Nethereum.Uniswap.Testing/UniSwapV2PairTests.cs

juanfranblanco avatar Sep 16 '22 04:09 juanfranblanco

Sorry, i can only see eth for dai and eth for dai for usdt, can you be more detailed?

Eternity714 avatar Sep 16 '22 05:09 Eternity714

Those are the examples on how to swap using Uniswap. If you are looking to do the reverse, check the other methods overloads, principle is the same.

juanfranblanco avatar Sep 16 '22 05:09 juanfranblanco

https://github.com/Nethereum/Nethereum.Uniswap-V2-and-V3/blob/main/Nethereum.Uniswap/UniswapV2Router02/UniswapV2Router02Service.cs#L497

juanfranblanco avatar Sep 16 '22 05:09 juanfranblanco

Got it !!! thanks for help https://github.com/Nethereum/Nethereum.Uniswap-V2-and-V3/blob/fec9bc6bb3a2a22243f63c526a0f0dafc6cab4e7/Nethereum.Uniswap/UniswapV2Router02/UniswapV2Router02Service.cs#L571

Eternity714 avatar Sep 16 '22 05:09 Eternity714