When coding my arbitrage bot I had to build it in excel first. Old habit. Thanks to https://github.com/paco0x/amm-arbitrageur for explaining the math.
Enter the reserves of 2 pairs and it will calculate the optimal amount to borrow and the profit.
(There is also a basic swap calculator to play with. Just enter AmountIn)
Coming soon