Algorithmic Arbitrage: Optimizing Swap Size for Maximum Profit