degenbot¶

A Rust MEV-bot core with a first-class Python driver shell, for Uniswap (V2, V3, V4), Curve V1, Solidly V2, Balancer V2, and Aave V3 integrations on EVM-compatible blockchains.

The Rust core is the engine; Python is a driver shell. Pool/token state, swap math, event decoding, solvers, the pump loop, and swap encoding all live in the pyo3-free Rust crates. Two equally first-class consumers share one engine:

  • Pure-Rust MEV bot — cargo add degenbot and build a fully functional bot in Rust only. API: docs.rs/degenbot

  • Python-driven MEV bot — drive the same core through a thin PyO3 layer, pip install degenbot. API & docs: this site

Start with Getting started — or open Architecture Decision Records if you want the design rationale first.

Where everything lives¶

Getting started — Getting started: installation, a five-minute code tour, and the one rule that surprises people (pools can’t be constructed directly).

Architecture — how the system is built:

…plus 14 more in the sidebar: executor grammar usage, CL tickmaps, Curve stableswap, revm diagnostics, storage layouts.

Architecture Decision Records — 40 settled design decisions, indexed by title and status; the “why” behind the code.

Command line — the degenbot CLI: Overview (pool inspection & management), Database CLI Commands (schema, migrations, cutover), Aave CLI Commands (Aave V3 tooling).

Operations — Controlling logging, tracing, and telemetry (log registry, Python-logging forwarding), Failure bucket configuration (reaction taxonomy for runtime failures), Your execution strategy, not degenbot’s (strategy configuration), Latency telemetry playbook (pump/solve latency from Jaeger & Prometheus).

Aave V3 integration — Aave V3 Protocol Documentation is the overview; Position Manager Flow and Amount Transformations Reference are good first entries into the per-flow behavior notes.

Working notes & benchmarks — lab reports and perf decisions: CL cache-lab sweep & rebuild matrix (S0-S7), Rayon Solver-Parallelism Lab Report, mimalloc purge-delay decision (epic AZZDBI, tasks XXJR3A + T3/T4), detached solve cycle decision (epic SRQEK5, tasks WV62TX + 4QKZE3 + SF3QLP).