For example Token A costs 1.00$ on Uniswap and 1.05$ on Sushiswap. So I can buy Token A on Uniswap and sell on Sushiswap for profit.
Let's suppose the next conditions:
- Uniswap reserve pool = 100 ETH / 100000 USDC. 1 ETH = 1000 USDC
- Sushiswap reserve pool = 97 ETH / 105000 USDC. 1 ETH = 1082 USDC
How to calculate an optimal swap amount (accounting price impact) on Uniswap to sell for the maximum profit on Sushiswap?