My question is did Uniswap and other dexes that have same concept of amountOutMin
would calc it like that:
amountOutMin = minimum amount that i want - the dex fee
or
amountOutMin = minimum amount that i want, and they will sub the fee and give me the rest
In code:
// So i should calc the fee then ask for minimum
routerToBuy.swapExactTokensForTokens(amountIn, amountOutMin - fee, path, address(this), deadline);
// Or i ask for the minimum and they will sub the fee then give me the rest (amountOutMin - fee)
routerToBuy.swapExactTokensForTokens(amountIn, amountOutMin, path, address(this), deadline);