Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
🚧 Development docs — they may describe unreleased work. For the installed package, see the stable docs.
degenbot documentation
degenbot documentation

Getting started

  • Getting started
  • API reference
  • degenbot
    • degenbot.aave
      • degenbot.aave.analysis
        • degenbot.aave.analysis.orchestrator
    • degenbot.abi
    • degenbot.aerodrome
      • degenbot.aerodrome.abi
      • degenbot.aerodrome.address
      • degenbot.aerodrome.functions
      • degenbot.aerodrome.math
      • degenbot.aerodrome.pools
      • degenbot.aerodrome.trackers
      • degenbot.aerodrome.types
      • degenbot.aerodrome.v2_pool_calc
      • degenbot.aerodrome.v2_pool_state
    • degenbot.arbitrage
      • degenbot.arbitrage.engine_registry
      • degenbot.arbitrage.policy
    • degenbot.balancer
      • degenbot.balancer.deployments
      • degenbot.balancer.libraries
        • degenbot.balancer.libraries.constants
        • degenbot.balancer.libraries.scaling_helpers
      • degenbot.balancer.math
      • degenbot.balancer.pools
      • degenbot.balancer.stable_pools
      • degenbot.balancer.types
    • degenbot.bot
    • degenbot.bot_lifecycle
    • degenbot.build_info
    • degenbot.builders
      • degenbot.builders.balancer_builder
      • degenbot.builders.balancer_builder_base
      • degenbot.builders.context
      • degenbot.builders.curve_pool_builder
      • degenbot.builders.erc20_builder
      • degenbot.builders.protocol
      • degenbot.builders.request
      • degenbot.builders.tick_data_fetcher
      • degenbot.builders.type_resolution
    • degenbot.calculations
    • degenbot.camelot
      • degenbot.camelot.abi
    • degenbot.chainlink
      • degenbot.chainlink.price_feed
    • degenbot.checksum_cache
    • degenbot.config
    • degenbot.constants
    • degenbot.contract
      • degenbot.contract.addresses
    • degenbot.crypto
    • degenbot.curve
      • degenbot.curve.abi
      • degenbot.curve.curve_stableswap_liquidity_pool
      • degenbot.curve.deployments
      • degenbot.curve.dy
      • degenbot.curve.math
      • degenbot.curve.per_block_cache
      • degenbot.curve.stableswap_pool_state
      • degenbot.curve.strategies
      • degenbot.curve.trackers
      • degenbot.curve.types
    • degenbot.db
    • degenbot.diagnostics
    • degenbot.dispatch
      • degenbot.dispatch.records
    • degenbot.erc20
      • degenbot.erc20.erc20
      • degenbot.erc20.ether_placeholder
    • degenbot.exceptions
      • degenbot.exceptions.arbitrage
      • degenbot.exceptions.base
      • degenbot.exceptions.infrastructure
      • degenbot.exceptions.pool
      • degenbot.exceptions.rpc
      • degenbot.exceptions.verification
    • degenbot.fleet
    • degenbot.fork
    • degenbot.logging
    • degenbot.operator
      • degenbot.operator.operator_channel
    • degenbot.pancakeswap
      • degenbot.pancakeswap.pools
      • degenbot.pancakeswap.trackers
    • degenbot.pathfinding
    • degenbot.provider
      • degenbot.provider.alloy_errors
      • degenbot.provider.async_provider
      • degenbot.provider.block_helpers
      • degenbot.provider.call_helpers
      • degenbot.provider.factory
      • degenbot.provider.offline_provider
      • degenbot.provider.sync
    • degenbot.registry
      • degenbot.registry.deployment_loader
      • degenbot.registry.deployment_records
      • degenbot.registry.pool
      • degenbot.registry.pool_type
      • degenbot.registry.session
      • degenbot.registry.token
    • degenbot.runner
      • degenbot.runner.bot_runner
      • degenbot.runner.build_paths
      • degenbot.runner.cli
      • degenbot.runner.config
      • degenbot.runner.diag
      • degenbot.runner.identity
    • degenbot.runtime_status
    • degenbot.strategy
    • degenbot.sushiswap
      • degenbot.sushiswap.trackers
    • degenbot.telemetry
    • degenbot.types
      • degenbot.types.abstract
        • degenbot.types.abstract.deployment
        • degenbot.types.abstract.erc20_token
        • degenbot.types.abstract.liquidity_pool
        • degenbot.types.abstract.pool_state
        • degenbot.types.abstract.pool_tracker
      • degenbot.types.address_comparable
      • degenbot.types.aliases
      • degenbot.types.chain
      • degenbot.types.concrete
      • degenbot.types.pool_protocols
      • degenbot.types.pool_type
      • degenbot.types.rpc_types
    • degenbot.uniswap
      • degenbot.uniswap.cl_companion
      • degenbot.uniswap.cl_pool_state
      • degenbot.uniswap.concentrated
        • degenbot.uniswap.concentrated.snapshot_readers
        • degenbot.uniswap.concentrated.types
      • degenbot.uniswap.deployments
      • degenbot.uniswap.math
      • degenbot.uniswap.snapshot_binary
      • degenbot.uniswap.trackers
      • degenbot.uniswap.types
      • degenbot.uniswap.v2_functions
      • degenbot.uniswap.v2_liquidity_pool
      • degenbot.uniswap.v2_pool_calc
      • degenbot.uniswap.v2_pool_state
      • degenbot.uniswap.v2_types
      • degenbot.uniswap.v3_functions
      • degenbot.uniswap.v3_liquidity_pool
      • degenbot.uniswap.v3_pool_calc
      • degenbot.uniswap.v3_pool_state
      • degenbot.uniswap.v3_snapshot
      • degenbot.uniswap.v3_types
      • degenbot.uniswap.v4_liquidity_pool
      • degenbot.uniswap.v4_pool_calc
      • degenbot.uniswap.v4_pool_state
      • degenbot.uniswap.v4_snapshot
      • degenbot.uniswap.v4_types
    • degenbot.updater
      • degenbot.updater.pool_updater_configs
    • degenbot.utils
      • degenbot.utils.bytes
      • degenbot.utils.solady
      • degenbot.utils.tasks
    • degenbot.validation
      • degenbot.validation.evm_values
    • degenbot.version

Architecture

  • Active Block Window — pump-owned block promotion (QMSTSV)
  • Adding a strategy family — the landed-seam runbook
  • Balancer V2 — Contract Reference
  • The block-epoch pipeline
  • Design note: per-block state machine for the pump’s block clock
  • BotRunner Extraction — architecture record for epic 5TSYKN
  • Curve StableSwap — Implementation Reference
  • Evaluation: hand-rolled scanner vs ast walk for the Python env-read gate
  • Executor command grammar
  • Executor grammar — usage guide
  • Executor facts-driven Plan walker — spike spec (v3_v4_v3)
  • Golden on-chain parity tests
  • Hull-edge seed evaluation (no-op verdict)
  • I/O-Free Pool Architecture
  • LFJ LBPair storage layout — UNVERIFIED-PENDING
  • Evaluation: combinatorial ending-range enumeration in the Möbius V3/CL solver
  • Operator Add-Path-At-Any-Time Surface (NWTUM3)
  • Evaluation: PyO3 abi3t feature for wheel distribution
  • RevM Inspector-native simulation diagnostics — implementation spec
  • Rust-Owned Settlement-Arbitrage Bot Architecture
  • Rust settlement-bot consumer parity ledger
  • Semantic Matching for Aave V3 Event Processing
  • Session object registry — design note
  • Simulation-revert diagnostics pipeline
  • StateView mechanism feasibility — block-epoch pipeline
  • Strategy seams — the substrate map and how to add a strategy
  • V2-as-degenerate-CL swap-step parity probe
  • V4 PoolManager storage layout — on-chain-truth verification slots
  • The role-switching worker fleet (degenbot-workers)

ADRs

  • Architecture Decision Records
    • ADR-001: I/O-Free Pool Architecture
    • ADR-002: Pool Type Registry as Module-Level Singleton
    • ADR-003: BotCore as the state layer, peer to ArbitrageEngine
    • ADR-004: Typed TickMap boundary for CL verifier + liquidity-apply seam
    • ADR-005: Polars-Inspired Three-Layer Architecture
    • ADR-006: Bot as the per-chain orchestrator (unified state, RPC ownership, Engine-as-EventSink)
    • ADR-007: Pool unregister seam (the symmetric half of register; B2 construction shape settled)
    • ADR-008: Per-block state machine for the pump’s block clock
    • ADR-009: Single-Source-of-Truth Versioning
    • ADR-010: Alembic Retention Through 0.6.x and Rust Schema Cutover
    • ADR-011: Auto-healed Alembic Retirement (Dump-and-Restore Cutover)
    • ADR-012: Spec-Bound Pool Admission Contract
    • ADR-013: The _ffi Seam Is Private (Pydantic Barrier)
    • ADR-014: Pool-State Deepening — Where the Trait Seams Live
    • ADR-015: Solver-Seam Relocation — the Resolve→Solve Boundary
    • ADR-016: ReorgPoolState — Pool-Owned Reorg Rollback (ADR-014 D3 Refinement)
    • ADR-017: Forward-Apply Pool-State Traits (ADR-016 Forward-Apply Twin)
    • ADR-018: Tracked Debt — bot_core↔solvers Fusion
    • ADR-019: In-Process revm as the Sole Simulation Executor; Strategy-vs-Engine Separation
    • ADR-020: Tier-3 — On-Chain Accuracy Oracle (revm + Canonical Reference Bytecode)
    • ADR-021: Solver-state accuracy is a fail-fast tripwire — divergence is a defect, never an input to auto-repair
    • ADR-022: Registration verify-lifecycle is core-owned — one provider per bot, tracked always verified
    • ADR-023: PyBotIo end-state is a shrunk translator + documented stays-python seam; full retirement deferred to the ERC-20/Curve core port (VK3YDM)
    • ADR-024: net-profit order index (degenbot-order-index)
    • ADR-025: The ExecutionAdapter seam — a deep, user-owned execution layer over the thin engine
    • ADR-026: Retire the “backrun” label — “settlement arbitrage” (strategy) and “arbitrage” (umbrella layer)
    • ADR-027: The block-pump dispatch seam — one owner, three application-specific pipes
    • ADR-028: The block-pump PumpDecision seam — pure producer + thin executor
    • ADR-029: The executor command grammar — axes over an open ledger, with a runtime-matrix source of truth
    • ADR-030: The derivation outcome is a tri-state; a validator Reject is always fatal
    • ADR-031: The executor grammar as a facts-driven Plan walker — per-protocol hop facts + mechanics, derived enclosure
    • ADR-032: #[pyclass] Python naming convention — clean names; Py prefix is Rust-internal
    • ADR-033: The encode funnel’s intake contract — one encode request per path, one context per session
    • ADR-034: ERC6909-vault profit capture — production wiring + the batchĂ—capture decline
    • ADR-035: Consolidate the AMM math family into degenbot-math + umbrella alias convention
    • ADR-036: Do not re-land the V3/V4 window guards — the refined terminal subsumes them
    • ADR-037: Engine Mutex sharding (RAYPAR)
    • ADR-037: The swap-simulation gate — one deep swap-read interface
    • ADR-038: The CL event-routing FSM — one table decides every event’s fate
    • ADR-039: State-lock — enumerated sim-anchor projection (K4ETHF)
    • ADR-040: Failure reactions are per-bucket — the closed failure taxonomy carries its own reaction
    • ADR-041: The block-epoch pipeline — one stage machine over a cheap-read data plane
    • ADR-042: One role-switching worker fleet — a bounded, budgeted host for every execution resource
    • ADR-043: The observability standard — four channels, a level rubric, one target taxonomy
    • ADR-044: Fleet intake liveness — BackstopTick + PostureEdge complete the host transition relation
    • ADR-045: The solve cycle as a deep module — ArbEngine regroups into registry + cycle + config
    • ADR-046: StageHandlers stays the pure product seam; PumpControl is the driver-facing control seam
    • ADR-047: Retire the ADR-006 D4 subscriber bus — compile is the guard for retired modules
    • ADR-048: Fleet boot registry — one keyed owner for the pooled roles’ boot facts
    • ADR-049: The engine’s interface is one stage seam — the engine recedes to composition machinery
    • ADR-050: A public EngineDriver is the Rust driver seam — the engine stays crate-private behind the one stage seam
    • ADR-051: The degenbot console is a Rust binary — one command model, an argv passthrough for Python
    • ADR-052: The database upgrades itself at open — Alembic retires in-tree ahead of 0.7
    • ADR-053: FFI Stub Generation — Retire the Hand-Maintained .pyi Set?
    • ADR-054: The strategy plumbing surface — ReplayOutcome, journal extractors, the planning workspace, and anchored discovery are the promoted seams
    • ADR-055: Pending-transaction strategy seams — MarketContext, PendingTxStrategy, SubmissionTarget, and the V4 closure
    • ADR-056: Retire the gated serving seam
    • ADR-057: The strategy host — one process, many drivers over one operator account
    • ADR-058: The strategy crate split — submission is mechanism, degenbot-strategy owns the plane
    • ADR-059: The pool family kernel — one taxonomy, capability tiers, species as data
    • ADR-060: Collapsing the V2 walk dispatch — representation vs interface
    • ADR-061: Pool-state provisioning is a plane capability — pool ingress, sealed seeds, the strategy kit
    • ADR-062: One operator file, four layers — node endpoints, chain id, and database path resolve through the typed config on every entry path
    • ADR-063: The file is portable, the secret is not — ${env:NAME} expansion for string-valued config keys
    • ADR-064: The session object registry is the cutover — identity is minted once, and the Python side is an adapter
    • ADR-065: The verdict is the single configuration authority
    • ADR-066: Deterministic Stub Generation — experimental-inspect + pyo3-introspection retire the hand-maintained .pyi set
    • ADR-067: The strategy substrate gets one home — ADR-061’s placement reopens

Command line

  • Overview
  • Background: Pool Architecture
  • Commands
  • Supported Exchanges
  • Fee Structure
  • Pool Discovery Events
  • Liquidity Update Processing
  • Mock Pool Helpers
  • Data Model Updates
  • Algorithm Details
  • Configuration
  • Dependencies
  • Database CLI Commands
  • Aave CLI Commands

Operations

  • Controlling logging, tracing, and telemetry
  • Failure bucket configuration
  • Your execution strategy, not degenbot’s
  • Latency telemetry playbook
  • degenbot alerts (T5, epic RMH23E)
  • Aave V3 Protocol Documentation
  • Borrow Flow
  • Collateral Management Flow
  • Eliminate Asset Deficit Flow
  • E-Mode Management Flow
  • Flash Loan Flow
  • Flash Loan Simple Flow
  • GHO Borrowing Flow
  • GHO Discount Flow
  • Liquidation Flow
  • Position Manager Flow
  • Repay Flow
  • Repay With aTokens Flow
  • Repay With Permit Flow
  • Rewards Claiming Flow
  • stkAAVE Slashing Flow
  • stkAAVE Staking Flow
  • stkAAVE Unstaking Flow
  • Supply Flow
  • Supply With Permit Flow
  • Withdraw Flow
  • Amount Transformations Reference

Working notes

  • CL cache-lab sweep & rebuild matrix (S0-S7)
  • UYSAXS — Hotpath verification
  • CoW Protocol Rust Survey — Auction Mechanics, Solvers, and Chain Interaction
  • Rayon Solver-Parallelism Lab Report
  • mimalloc purge-delay decision (epic AZZDBI, tasks XXJR3A + T3/T4)
  • RATR5A + CXRHW3 closure census (pair-review requirement, landed 2026-09-04)
  • detached solve cycle decision (epic SRQEK5, tasks WV62TX + 4QKZE3 + SF3QLP)
Back to top
View this page

degenbot.builders¶

Pool builders that fetch on-chain data and construct I/O-free pool instances.

Submodules¶

  • degenbot.builders.balancer_builder
  • degenbot.builders.balancer_builder_base
  • degenbot.builders.context
  • degenbot.builders.curve_pool_builder
  • degenbot.builders.erc20_builder
  • degenbot.builders.protocol
  • degenbot.builders.request
  • degenbot.builders.tick_data_fetcher
  • degenbot.builders.type_resolution
Next
degenbot.builders.balancer_builder
Previous
degenbot.build_info
Copyright © 2026, degenbot contributors
Made with Sphinx and @pradyunsg's Furo
On this page
  • degenbot.builders
    • Submodules