anyone know whats "amountOutMin" paramter in pancakeswap rooter v2 for swap tokens?
Sep 2, 2023, 12:35 PM
https://docs.uniswap.org/contracts/v2/reference/smart-contracts/router-02
Sep 2, 2023, 12:42 PM
Thanks, and does slippage will affect on this param it?
Sep 2, 2023, 12:49 PM
That param IS the slippage :D
Frontends does the calcs for you and set the number
Sep 2, 2023, 1:24 PM
Lol, okay
Sep 2, 2023, 1:25 PM
Of course it's not in %
(The % of difference between your amount & the min amount is the slippage)
But the only variable in the calc is the amountOutMin (based on a fixed amount of tokens)
(The % of difference between your amount & the min amount is the slippage)
But the only variable in the calc is the amountOutMin (based on a fixed amount of tokens)
More slippage = lower amountOutMin
AmountOutMin = 0 = no slippage
And today you don't wanna send 0 amountOutMin transactions due to Mev bots
Sep 2, 2023, 1:27 PM
Oh reah true, but whats furmula for calcu the amountOutMin?
Sep 2, 2023, 1:28 PM
Let's say you want to trade 100 tok @20% slippage
100- (100*20/100) = 80
Amount is 100
MinAmount is 80
The result is 20% slippage
100- (100*20/100) = 80
Amount is 100
MinAmount is 80
The result is 20% slippage
Sep 2, 2023, 1:30 PM
Is it possible to give us a contract for this purpose?
Because when I set amountOutMin it to zero it works, but when I set it with 10% slippage it doesn't work!
Because when I set amountOutMin it to zero it works, but when I set it with 10% slippage it doesn't work!
Sep 2, 2023, 1:30 PM
Trace it with hardhat
Slippage is needed also when you have fees on transfer (buy/sell fees)
Sep 2, 2023, 1:31 PM
Okay man Thankyou
Sep 2, 2023, 1:31 PM