Finding The Optimum Price Imput for an Abritrage

Hello everyone,

I hope this message finds you all well. I’m working on an MEV (Miner Extractable Value) arbitrage bot designed for the Arbitrum network in JavaScript. We’re looking for insights and guidance on how to find the optimal input amount for our bot.

If anyone here has experience with Arbitrum or other notworks with JavaScript or python and can offer assistance or suggestions, I’d greatly appreciate your input. Feel free to reply here or reach out to me directly.

Thank you in advance for your help, and we look forward to your contributions.

Best regards,

Sam Nassery

1 Like

Hi Sam,

My first remark would be that JS is way probably too slow to be able to compete on Arbitrum. Arbitrum is a FCFS blockchain where all that matters is latency.

As for your question, most searchers use an optimisation algorithm (some variation of binary search) to do that optimisation. There exists however closed-form formula for some DEXes.


WoW Thank you for your answer, and what language do you recommend or witch chain do you recommend doing it to, we tryed alot of chains like fantom, binance,polygon and once ethereum. where is it possible to get this information :smiley: scratching though glas is challenging, would be glad for your next answer. :smiley:

I’d recommend looking into the Bellman-Ford algorithm. See this article explainer

Currency Arbitrage using Bellman Ford Algorithm | by Anil Pai | Medium.

1 Like

Seems like Bellman ford is easier way for finding the shortest path. But what would be the best method to find the optimal input amount for an arbitrage?