finds.dev← search

// the find

0xNineteen/solana-arbitrage-bot

★ 804 · Rust · MIT · updated Apr 2023

solana arbitrage bot across multiple spot dexs

A Rust implementation of a Solana DEX arbitrage bot from early 2022, covering Serum, Aldrin, Saber, Mercurial, and Orca. It includes both off-chain discovery logic and an on-chain swap program to handle atomic multi-hop swaps. Primarily educational — the author open-sourced it after deciding the lone-wolf secrecy of MEV wasn't for them.

The mainnet-forking test harness for verifying swap quote accuracy is genuinely useful — most arb repos skip this entirely and just hope their math is right. The reverse-engineering approach to DEX interfaces (digging through Jupiter's npm bundle since there were no public SDKs) is well-documented and shows real work. The on-chain program for multi-hop atomicity solves a real problem: mid-swap slippage between legs corrupts your input amount for subsequent legs. The brute-force opportunity search with parallel amount sizing (N, N/2, N/4...) mirrors what production bots were actually doing at the time.

This is a 2022 snapshot. Serum is dead, Aldrin is dead, Mercurial was exploited and wound down, and Saber is a ghost town — roughly 80% of the supported DEXes no longer exist or have meaningful liquidity. Pool metadata is hardcoded JSON files that were stale by the time the repo was archived. There's no dynamic pool discovery, so adding a new DEX or even a new pool on a surviving DEX requires manual JSON editing. The README is two sentences; understanding what's actually happening requires reading the source and a linked blog post.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →