Cross-DEX arbitrage bot for Base and Arbitrum. Scans live market data, detects price gaps between DEXes, and runs online dry-run (default), local paper, or live on-chain swaps.
Default mode is simulate — real QuoterV2 / Aerodrome / PancakeSwap quotes via RPC eth_call, no broadcast. Flip to live only when ready.
| Mode | Behavior | Needs |
|---|---|---|
paper |
Local AMM math + SQLite (offline fallback) | nothing |
simulate |
Default — on-chain QuoterV2 round-trip (Uni/Aero/PCS); ledger updated; never sends txs | RPC URLs (ONEINCH_API_KEY optional) |
live |
Broadcast swaps via 1inch; hard size cap | + WALLET_PRIVATE_KEY, funded wallet, live_enabled: true |
When HL funding is abnormally rich/cheap, take the receiving side with a hard stop. Real rates; can get stopped out. Live = HL perps.
Directional trend + funding tilt on 15m candles. Higher ROC bar to avoid fee bleed.
Aave / Fluid / Compound USDC via live DefiLlama APY.
- Funding carry is how retail-consistent PnL shows up in 2026 research (HL ↔ CEX / single-venue carry). Simulate uses live HL rates; live needs an HL wallet + hedge plan.
- Spatial DEX arb alone is not a consistent profit engine against MEV bots.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env- Put RPC URLs in
.env(publicnode works; dedicated Alchemy/Infura is more reliable):BASE_RPC_URL=https://base.publicnode.com ARBITRUM_RPC_URL=https://arbitrum.publicnode.com API_PORT=8005 - Optional:
ONEINCH_API_KEYfor live path / aggregator mode - Confirm
execution_mode: simulateandsimulate_quote_mode: onchaininconfig/settings.yaml - Run:
python -m src
- Dashboard: http://localhost:8005 — badge should show SIMULATE
- Prove repeated simulate wins (see
live_require_simulate_wins) - Dedicated wallet with limited funds (two non-atomic legs — inventory risk)
- Fund with USDC (+ a little ETH for gas) on Base
- Set
WALLET_PRIVATE_KEY,ONEINCH_API_KEY,execution_mode: live,live_enabled: true, keeplive_max_trade_usd: 25 - Restart and watch the first trade carefully
Edit config/settings.yaml:
execution_mode:paper|simulate|livesimulate_quote_mode:onchain|pool_direct|oneinchlive_max_trade_usd,live_enabled, spread/risk limits, DEXes
# Engine + dashboard
python -m src
# CLI monitor loop
PYTHONUNBUFFERED=1 python -m src.monitor
# Portfolio / reset
python -m src.cli status
python -m src.cli reset| Endpoint | Description |
|---|---|
GET /api/portfolio |
Balance, P&L, win rate |
GET /api/status |
Mode, 1inch/RPC readiness, risk |
GET /api/trades |
Trade history |
GET /api/equity |
Equity curve |
GET /api/opportunities |
Detected / rejected / executed |
GET /api/activity |
Live process feed |
Online dry-run is closer to reality than local AMM math, but still not a guarantee of live P&L. Real arb involves MEV, latency, failed txs, and stuck inventory between legs. Start tiny.