BellmanFord arbitrage – Fees and amount optimizer

a b c -> -Ln(rate) ; rate = buy?ask:1/bid

exp(-a)*0.997*exp(-b)*0.997*exp(-c)*0.997 > 1