Ethereum back-run flashloan arbitrage bot built for MEV extraction with zero starting capital. Unlike sandwich bots, it needs no upfront deposit: profit comes from correctly constructing chains and precisely computing the real price curve. Niche and less competitive — the bot earns only on unique pending transactions that appear during elevated volatility.
graph TD
subgraph Data Ingestion
A[Mempool Stream] -->|Kafka/WS| B(Pending Coordinator)
W[WebSocket Services] -->|Quotes/Gas| B
end
subgraph Core Engine
B -->|Filter & Norm| C{Graph Engine}
C -->|DFS & Chain Build| D[Split Router]
D -->|V2/V3/V4 Unification| D
end
subgraph Execution
D -->|Optimize Profit| E[Profit Engine]
E -->|Validation| F[Flashbots Signer]
F -->|Bundle Send| G((Ethereum Network))
end
style A fill:#0D1117,stroke:#00f0ff,stroke-width:2px,color:#fff
style B fill:#161b22,stroke:#00f0ff,stroke-width:1px,color:#fff
style C fill:#161b22,stroke:#7000ff,stroke-width:2px,color:#fff
style D fill:#0D1117,stroke:#7000ff,stroke-width:2px,color:#fff
style E fill:#161b22,stroke:#00ff00,stroke-width:1px,color:#fff
style G fill:#0D1117,stroke:#00ff00,stroke-width:2px,color:#fff
linkStyle default stroke:#00f0ff,stroke-width:2px
|
Mathematically merges v2/v3/v4 curves into a single economic equivalent, searching for the true profit across chains. |
DFS with limits on chain length/count, prioritizes starting tokens for extremely fast graph processing. |
|
Bitquery Kafka or WebSocket/Bloxroute. Feeds pending transactions into the graph and optimization before block inclusion. |
Flash sources + split_router = execution without deposits. Protection against fund loss if a transaction is dropped. |
Click to expand code navigation
| Component | Path | Description |
|---|---|---|
| Entry Point | src/main.rs |
Dependency wiring, worker startup, event channels. |
| Graph | src/graph/* |
Build logical nodes/chains, DFS limits. |
| Split Router | src/engine/split_router/* |
Normalize v2/v3/v4, optimize continuous plan. |
| Profit Engine | src/engine/profit_engine.rs |
Profit calculation, execution prep. |
| Pending | src/pending_websocket/* |
Bitquery Kafka, event normalization, overlay caches. |
| WebSockets | src/*_websocket/* |
Quotes, events, gas, tick snapshots. |
| Flashbots | src/flashbots/* |
Go FFI signer for transaction signing. |
| Contracts | smart_contract/* |
EthFlarb.sol, Bribe.sol and deploy scripts. |
- ~72k chains and ≤600 starting pools: 8 cores / 32 GB RAM.
- More chains or >600 pools: 16 cores / 64 GB RAM (otherwise memory bound).
Dependencies: Rust (Stable) • Go • Node.js (for contracts)
Library required to sign Flashbots transactions. Without it cargo will fail.
cd src/flashbots/flashbots_go_signer
go build -buildmode=c-shared -o libflashbots_signer.so
# Export the variable for runtime
export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH# In project root
cargo build --release
# or 'cargo run' for debug modecd smart_contract
npm install && npm run compile
# Deploy
npm run deploy:mainnet
# or npx hardhat run scripts/deploy.ts --network mainnetCopy .env.example to .env. Key parameters:
- RPC/WS:
QUICK_NODE_RPC_API,QUICK_NODE_WS_API_*. - Mempool:
BITQUERY_KAFKA_USERNAME/PASSWORD,MEMPOOL_PROVIDER(bitquery|bloxrouter). - Flashbots:
FLASHBOTS_RPC_API, private key and contract address. - Graph:
GRAPH_API_KEY. - Logging:
LOG_STATUS.
- Start: Load config and RPC/WS endpoints.
- Snapshot: Fetch head block, prep tick snapshot.
- Initialize: Fetch pools, validate ticks, fix initial state.
- Graph: Build (logical nodes → edges → chains), cache.
- Services: Start WebSocket (quotes, events, gas).
- Pending: Start pending coordinator, ingest transactions, overlay snapshots.
- Math Loop: Profit engines + split_router (compute equivalent v2/v3/v4 curves, optimize).
- Execution: Flashbots signing (Go FFI) and send.
Tip
Tuning Constants:
- Starting addresses:
get_all_addresses()→ ETH/WETH. - Chain length:
MAX_CHAIN_LENGTH = 6,MIN_CHAIN_LENGTH = 3. - Filters:
MIN_PROFIT_FOR_CHAIN = 14. - Gas: Default fixed 1 gwei. In pending pipeline
gas_limit=7_700_000.
Warning
Risks:
- Low competition → revenue only on unique pending transactions during volatility.
- Proper RPC/WS subscriptions and Kafka are required, otherwise the pipeline will not start.
deploy.tsscript can fail on parsing, but deployment still completes.
- RPC + WS subscription (recommended Alchemy).
- Bitquery Kafka access.
- Keep ≥ $50 on the wallet to cover fees and tests.

