I'm currently working on a project that involves implementing a best path searcher for multi-hop swaps in JavaScript. Specifically, I'm looking for a code sample or library that can efficiently find the optimal sequence of trades across different exchanges or liquidity pools to exploit arbitrage opportunities.

Could anyone provide me with a code example or recommend a library that includes a pathfinding algorithm suitable for this task? I'm particularly interested in solutions that consider factors like transaction fees, slippage, and liquidity constraints.

Thank you in advance for any assistance or guidance you can provide!

1 Answer 1


See Uniswap Autorouter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.