"How to Build a Solana Arbitrage Bot in 2026"
"A step-by-step guide to building a real-time arbitrage bot on Solana using Jupiter and Raydium — including code snippets and architecture decisions."
Why Solana?
Solana's sub-second block times and near-zero transaction fees make it the only L1 where retail arbitrage is actually viable. Ethereum L1 is too slow, L2s fragment liquidity.
Core Architecture
Your arbitrage bot needs three components:
- Price Scanner — polls DEXes for spread opportunities
- Execution Engine — submits swap transactions atomically
- Monitoring — tracks P&L and alerts on failures
Price Scanner
The scanner fetches quotes from multiple DEXes simultaneously. On Solana, the key DEXes are Jupiter (aggregator), Raydium (AMM), and Orca (concentrated liquidity).
const scanner = async () => {
while (true) {
const routes = await jupiter.getRoutes({
inputMint: SOL,
outputMint: RAY,
amount: scanAmount,
slippage: 0.5,
});
for (const route of routes) {
if (route.priceImpact > MIN_SPREAD) {
await executeTrade(route);
}
}
await sleep(1000);
}
};
Execution Strategy
The trick is executing before the spread closes. You need:
- A pre-funded hot wallet
- Priority fees (0.001-0.01 SOL) to jump the queue
- Fallback RPC endpoints (we use 3+)
Real Results
Our Strike Engine has executed 2,700+ trades. The key insight: REVERSE direction (buying the dip and selling the spike) is consistently more profitable than chasing momentum.
Sources
Want to Build Something Similar?
We turn ideas into working software. Let's talk about your project.
Start a Project