Scan price differences across Ethereum DEXes for arbitrage opportunities with real-time Telegram alerts β powered by DeFi Llama + CoinGecko API.
DEX arbitrage is the practice of exploiting price differences for the same token across different decentralized exchanges β buying low on one DEX and selling high on another for risk-free profit.
This scanner detects opportunities using:
- π DeFi Llama API β primary multi-DEX price source
- π° CoinGecko API β price verification & fallback
- π 6 DEXes compared β Uniswap V2/V3, SushiSwap, Curve, Balancer, 1inch
- π Multi-DEX Scanning β compare prices across 6 DEXes simultaneously
- π° Profit Calculator β estimate net profit after gas costs
- πͺ 10 Token Pairs β WETH, USDC, USDT, DAI, WBTC, LINK, UNI, AAVE, CRV, MKR
- π¨ Severity Rating β HIGH/MEDIUM/LOW based on profit potential
- π‘ Auto Monitor β background scanning every 2 minutes
- π Telegram Alerts β instant notification on high-profit opportunities
- π Scanner Stats β track total scans, found opportunities & best profits
- π€ Telegram Bot β 7 interactive commands
pip install web3 requestsOpen arbitrage_scanner.py and configure:
ETHERSCAN_API_KEY = "your_etherscan_key"
INFURA_URL = "https://mainnet.infura.io/v3/your_infura_key"
TELEGRAM_TOKEN = "your_telegram_bot_token"
TELEGRAM_CHAT_ID = "your_chat_id"python arbitrage_scanner.pypython arbitrage_scanner.py scan| Command | Description |
|---|---|
/arb_scan |
Scan all tokens for opportunities |
/arb_token <symbol> |
Scan specific token (e.g. WBTC) |
/arb_top |
Top 5 opportunities by net profit |
/arb_pairs |
List tracked tokens & current prices |
/arb_monitor on/off |
Toggle auto monitoring |
/arb_stats |
Scanner statistics |
/arb_settings |
Show current configuration |
π± ARB OPPORTUNITY β WBTC
ββββββββββββββββββββββ
π΄ Severity : HIGH π΄
π Spread : 0.6240%
π₯ Buy @ Uniswap V2
Price: $43,250.123400
π€ Sell @ SushiSwap
Price: $43,520.456700
π° Profit Estimate ($10,000 trade):
- Gross Profit : $62.40
- Gas Cost : $15.00
- Net Profit : $47.40 (0.4740%)
β° 2026-05-31 08:14:22
| Severity | Net Profit | Action |
|---|---|---|
| π΄ HIGH | β₯ $100 | Immediate alert sent |
| π‘ MEDIUM | $30 β $99 | Logged & reported |
| π’ LOW | $5 β $29 | Shown in scan results |
arbitrage_scanner.py
βββ PriceFetcher β Multi-source price fetching
β βββ get_token_price_coingecko() β CoinGecko price
β βββ get_token_price_defillama() β DeFi Llama price
β βββ get_dex_prices() β Simulate DEX price spread
β βββ get_eth_price() β ETH/USD price
βββ ArbitrageEngine β Core opportunity detection
β βββ scan_token() β Scan single token across DEXes
β βββ scan_all() β Scan all tracked tokens
β βββ scan_specific_token() β Scan by symbol
β βββ get_top_opportunities() β Top N by profit
β βββ get_stats() β Scanner statistics
βββ ArbitrageBot β Telegram bot with 7 commands
βββ _monitor_loop() β Background scanning thread
| Source | Usage |
|---|---|
| DeFi Llama | Primary token prices |
| CoinGecko API | Price verification & fallback |
| Infura | Ethereum RPC node |
| Token | Contract |
|---|---|
| WETH | 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 |
| USDC | 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 |
| USDT | 0xdAC17F958D2ee523a2206206994597C13D831ec7 |
| DAI | 0x6B175474E89094C44Da98b954EedeAC495271d0F |
| WBTC | 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599 |
| LINK | 0x514910771AF9Ca656af840dff83E8264EcF986CA |
| UNI | 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 |
| AAVE | 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9 |
| CRV | 0xD533a949740bb3306d119CC777fa900bA034cd52 |
| MKR | 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2 |
| Variable | Default | Description |
|---|---|---|
TRADE_AMOUNT_USD |
$10,000 | Simulated trade size |
GAS_COST_USD |
$15 | Estimated gas per arb TX |
MIN_SPREAD_PCT |
0.3% | Minimum spread to flag |
MIN_PROFIT_USD |
$5 | Minimum net profit to alert |
POLL_INTERVAL |
120s | Auto-scan frequency |
This tool is for educational and informational purposes only. Real arbitrage requires flash loans, MEV infrastructure, and sub-second execution. Always do your own research before trading.
web3>=6.0.0
requests>=2.28.0
Rizal β @rizalcodes
Building Web3 tools with Python πβοΈ
MIT License β free to use, modify, and distribute.