Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Building a Multi-DEX Arbitrage Scanner on Arbitrum: When APIs Fail, Query the Blockchain

Description and use

The author faced API limits and errors when building an arbitrage scanner on Arbitrum. The solution was to query DEX contracts directly, validate liquidity, and use correct chain‑specific addresses and ABIs, resulting in a reliable scanner.

Problem

Free and paid APIs for DeFi data were unreliable, misconfigured, or returned misleading prices, preventing accurate arbitrage detection on Arbitrum.

Outcome

By querying contracts directly and validating liquidity, the author overcame API limitations and built a reliable arbitrage scanner on Arbitrum.

Workflow

  • 1. Identify target DEXs (Uniswap V3, Sushiswap, Camelot).
  • 2. Attempt to fetch prices via 1inch API; handle 402/timeout errors.
  • 3. Switch to Alchemy RPC with ethers.js; correct chain ID and key.
  • 4. Detect phantom pools by checking liquidity before price calculation.
  • 5. Verify chain‑specific contract addresses (e.g., Uniswap QuoterV2).
  • 6. Handle ABI differences for compatible protocols (Camelot).
  • 7. Replace API calls with direct contract queries using JsonRpcProvider.
  • 8. Implement liquidity checks and correct address/ABI usage.
  • 9. Run scanner and alert on profitable opportunities.

Evidence

Free APIs have hard limits that don't care about your timeline. When they hit that limit, you're blocked.

Source

Sushiswap doesn't have real liquidity on Arbitrum. It's a ghost town.

Source

  • Record date: 2026-09-21T01:46:43.488Z