Bot configuration keys (Rust core, generated)¶
One typed BotConfig value is the single source of truth for all runtime configuration (crate degenbot-config, schema constant SCHEMA). Every key is settable from the config file OR the environment with the same name tree.
Precedence¶
Highest wins (12-factor parity; recorded here by the schema and asserted by the loader tests):
CLI / explicit argument (loader override keys accept the env name or the TOML path)
Environment variable (the
Env varcolumn)Config file (TOML tree selected by
--config <path>)Built-in defaults (shown below)
The loader is fail-closed: unparsable values and unknown file keys are reported, never silently ignored.
Env names that are not DEGENBOT_*: VERIFICATION_RETRY_MAX_ATTEMPTS, VERIFICATION_RETRY_BASE_DELAY, VERIFICATION_RETRY_MAX_DELAY, VERIFICATION_RETRY_JITTER. They predate the prefix and keep their names, so an export an operator has already written stays honored.
nodes¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Per-chain JSON-RPC HTTP endpoint per chain id: [nodes] http = { 1 = “https://eth.example/rpc”, 8453 = “https://base.example/rpc” } (or [nodes.http] with one |
|
|
|
|
Per-chain subscription (WebSocket) endpoint per chain id, same table and family shape as nodes.http. The env layer is the name family DEGENBOT_RPC_WS_CHAINID_<chain_id>. Every value must be a ws:// or wss:// URL; a subscription consumer takes this transport or nodes.ipc, never nodes.http. |
|
|
|
|
Per-chain local IPC endpoint per chain id (a node running beside the bot, reachable over a Unix socket or a Windows named pipe), same table and family shape as nodes.http. The env layer is the name family DEGENBOT_RPC_IPC_CHAINID_<chain_id>. Every value must be an |
session¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Chain id the session runs against (a positive integer; the pre-0.6 top-level default_chain_id key is retired and refused with a pointer here). The endpoint tables are keyed by chain id, so this is the chain whose entry the node resolvers read; unset means no chain was named and a node endpoint cannot be selected. |
database¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
SQLite database file this process owns. A leading ~ expands against HOME, and the declared default rebases onto an absolute $XDG_STATE_HOME; an explicit file or environment path expands as written. The pre-0.6 [database] |
runtime¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Ambient I/O runtime worker count; when unset it is derived from the cgroup CPU budget after the solve bins take theirs (see solve.solve_cpus / solve.solve_headroom). |
|
|
`FleetProfile(Auto |
Pinned |
Serial)` |
telemetry¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
`Option<LogLevel(Off |
Error |
Warn |
|
|
|
|
Per-domain console escalation from a validated map: [telemetry.diag] with sim = “debug”, or the env form sim=debug,solver=trace. A typo’d domain is a boot error. Ignored with one WARN when RUST_LOG is set. |
|
|
|
|
Enable the OTel OTLP span layer and the Prometheus metrics endpoint; |
|
|
|
|
Prometheus scrape endpoint bind address (only active when otel is on). |
|
|
|
|
OTLP endpoint used by the opt-in Jaeger E2E test. |
|
|
|
|
Gate for the network-accessible Jaeger E2E test (Jaeger must be reachable at jaeger_endpoint). |
diagnostics¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Interval in seconds between tracemalloc snapshot-diff dumps to stderr; 0 (or unset) arms nothing. A flat traced-current under a climbing RSS pins the growth outside the Python object graph, so the probe splits a memory diagnosis in half. |
|
|
|
|
Interval in seconds between /proc/self RSS/VmHWM CSV sampler rows; 0 (or unset) arms nothing. The sampler is read-only – no snapshots, no allocator calls – so it never perturbs the behavior being measured. |
|
|
|
|
CSV output file for the procmem sampler, one row per procmem_secs interval. The parent directory is created when the probe arms. |
|
|
|
|
Seconds after which faulthandler dumps every thread’s stack; 0 (or unset) arms no watchdog. A dump is the only record of where a wedged process was when it stopped answering. |
logging¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Root directory for per-session run artifacts: each session lands in |
|
|
|
|
Also mirror the session stdout log to stderr (interactive runs); the file-only posture is the default. A bad value fails the load rather than silently picking a sink. |
|
|
|
|
Explicit offline-review JSONL capture path. When unset, the trace helpers append to the session’s |
|
|
|
|
Dry-run fixture frames path: a captured frame JSONL replaces the live feed and is processed once, in order. Unset keeps the live feed. |
persistence¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Root directory for durable, process-lifetime-independent bot state (e.g. the backrun arm’s gap-quarantine journal). State here OUTLIVES sessions and is deliberately NOT nested under a per-session run directory. The default is the XDG state home ( |
allocator¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Fixed mimalloc purge delay in ms overriding cadence discovery entirely (clamped 1_000..=600_000). |
|
|
|
|
Whether mimalloc cadence discovery may re-apply the purge option; |
|
|
|
|
Purge-delay multiplier over the mean block interval (clamped 1.0..=20.0). |
|
|
|
|
Purge with MADV_DONTNEED instead of MADV_FREE ( |
state_lock¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Capture full backtraces at lock acquire (diagnostics). |
|
|
|
|
Warn threshold (ms) for read-hold age and write-acquire block (clamped >= 1). |
|
|
|
|
Enable hold-tracking diagnostics for soak/incident forensics. |
|
|
|
|
Watchdog thread-registry dump path; |
pump¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Publish-debounce settle window in ms ( |
|
|
|
|
Early-slice window in ms; |
|
|
|
|
Stream solved arms immediately (T3 default); |
|
|
|
|
WS completeness gating (newHeads + logs double-delivery check); |
|
|
`QuiesceMode(Fixed |
Adaptive)` |
|
|
|
|
|
Adaptive mode: lower bound (ms) of the trailing settle window (clamped >= 1; a 0/garbage value never collapses the window to zero). |
|
|
|
|
Adaptive mode: upper bound (ms) of the trailing settle window; the estimator never grows beyond it (inherits the debounce parse contract: unset/zero/invalid falls back, never 0). |
|
|
|
|
Adaptive mode: safety multiplier over the silence-gap EWMA (W = EWMA × margin, then floor/ceiling clamp). |
|
|
|
|
Adaptive mode: EWMA smoothing constant over per-block max silence gaps (≈10-block memory); clamped to (0, 1]. |
|
|
|
|
Adaptive-mode runtime backstop: more than this many benign late-admit events in a sliding hour holds the window at quiesce_ceil_ms until the ledger drains. |
trace¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Construct the hotpath profiling guard (default OFF; build must enable the profiling feature too). |
solve¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Override the detected solve CPU budget (worker bin count). |
|
|
|
|
Override the I/O headroom carved out of the CPU budget before solve bins. |
|
|
|
|
Inline-sim stance (T2 worker-side clamp path); |
|
|
|
|
Chunked parallel resolve stance; |
|
|
|
|
Inline-sim worker count (clamped 1..=32; unparsable falls back to derived default at the site). |
|
|
|
|
QTZGFL capacity-modulated admission stance: unset/ |
|
|
|
|
QTZGFL: un-merged-result pipe depth target in KEYS (pools) — the draw budget headroom. Clamped at engine construction to 1..=DETACHED_INFLIGHT_CAP (DETACHED_INFLIGHT_CAP is only the default/clamp for this key now, no longer a runtime cap verdict); default 8 = DETACHED_INFLIGHT_CAP. |
|
|
|
|
QTZGFL: retained (carried) key retention window W in blocks — on each block advance the ledger prunes buckets older than head - W and counts degenbot.detached.leads_expired. Default 50. |
|
|
|
|
Minimum path profit floor in wei (decimal text; TOML: quoted string). |
|
|
|
|
Legacy event-solver path is enabled by |
|
|
|
|
Loop-15 nested event census counters in the CL walker ( |
|
|
`AnchorSweep(Off |
CenterOnly |
Full)` |
|
|
|
|
Profit-envelope max tangent lines cap. |
|
|
|
|
Profit-envelope sampled-compose lines cap. |
|
|
|
|
CL-solver walk memo (result caching) ( |
|
|
|
|
Walk-memo recomposition census ( |
|
|
|
|
CL projection memo cache; |
fleet¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Terminal override of the fractional cgroup CPU quota (cores) feeding the fleet budget sum check; unset detects from the cgroup (ADR-042 §5). |
|
|
|
|
Fleet-budget reserve share H (Python bridge, pump, OTel, async GC) in cores; overrides the fixed default 1 (design doc §5). |
|
|
|
|
Fleet Solver CPU share S in cores; terminal when set and it participates in the same startup sum check (default: floor(quota) − H − A − R − M; S < 2 fails the boot). |
|
|
|
|
SimDriver slot cap (duty-counted; spendable from the fractional-quota remainder); default 4, today’s SimSlots cap. |
|
|
|
|
PoolStateUpdater slot cap (the registration intake station: duty-counted, spendable from the fractional-quota remainder, Deferrable cordon class); default 4. |
|
|
|
|
Throttle events within the enter window that cordon the fleet (design doc §6 enter trigger; Q5 amendment delivered: runtime-tunable via the operator channel — |
|
|
|
|
Rolling window (ms) for the throttle-event burst enter trigger. |
|
|
|
|
Throttled-time duty percent over the duty window that cordons the fleet (enter trigger; 2.0 = >2%). |
|
|
|
|
Trailing window (ms) over which throttled-time duty is evaluated. |
|
|
|
|
Clean-window hysteresis (ms) required before cordon exits (design doc §6: 10 s of clean windows). |
|
|
|
|
SimDriver new-lease cap while cordoned; in-flight sims are never cancelled (default: half the slot cap). |
|
|
|
|
Backstop recv-timeout (ms) armed iff a host intake backlog is non-empty; on timeout the host re-runs the grant pump, so a posture lift with no further message still drains held units (TB4QGX T2). Clamped to >= 1 ms at the site so a garbage value cannot collapse into a busy-spin. |
|
|
|
|
Consecutive admitted-but-no-progress host intake passes (backlog non-empty, admission admits, yet no dequeue and no grant) before the host fails LOUDLY (TB4QGX T4). Legitimate WaitCap/WaitPosture holds never count, and only real progress resets the counter. Clamped to >= 1 at the site so a garbage value cannot trip on the first pass. |
capture¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Gate degenerate-path capture (presence gates; loader parses a bool). |
|
|
|
|
Gate-capture output JSONL path. |
|
|
|
|
Max paths captured per gate-capture run. |
|
|
|
|
Heavy CL-path solve capture (presence gates; loader parses a bool). |
|
|
|
|
Max captures per run (deduped by path id). |
|
|
|
|
Capture only paths with at least this many walk sims. |
|
|
|
|
Capture only paths whose solve time is at least this many microseconds. |
|
|
|
|
Solver-capture output JSONL path (site-specific fallback). |
|
|
|
|
Swap-capture correctness example gate ( |
verify¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Per-myriad (1/10_000) sampling rate for verify spot-checks (0 = off). |
|
|
|
|
Attempts for a transient verification RPC failure (per-call transport / provider-init) before it propagates. A genuine on-chain mismatch is never retried. Below 1 the policy is not a policy, so building one refuses rather than retrying nothing. |
|
|
|
|
First backoff wait in seconds for a retried verification call; grows exponentially from here. A negative or non-finite value is refused when the policy is built. |
|
|
|
|
Ceiling in seconds on one verification backoff wait. A value below verify_retry_base_delay is refused when the policy is built, because the cap would sit under the first wait it is meant to bound. |
|
|
|
|
Upper bound in seconds of the uniform jitter added to one backoff wait, so a recovering node is not hit by a synchronized retry herd. A value outside 0..=1 is refused when the policy is built. |
simulation¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Override the execute() gas limit (decimal u64; garbage/0 falls back at the site while migrating). |
|
|
|
|
Simulate against executor bytecode injected into the evm overlay instead of a deployed contract. Injection mode also gates live submission off for safety; |
|
|
|
|
Abort the process when a sim fails (the live trap used to capture V3-hop fixtures). |
|
|
|
|
Corpus fixture for the offline executor A/B probe (ignore-listed test). |
|
|
|
|
Comma-separated thread-count arms for the offline executor A/B probe. |
|
|
|
|
Passes per arm for the offline executor A/B probe. |
|
|
|
|
Sims in flight per block before the pipeline’s submitter is held back; 1 reproduces the serial reference (one sim, FIFO submit) for an offline soak. Clamped to >= 1 at the use site. |
|
|
|
|
Comma-separated failure buckets the sim-failure tripwire does not count (e.g. |
pathfinding¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Discovery-sweep delivery batch size (paths per async batch): the worker thread collects this many paths before the async consumer yields them and gives the event loop one turn. A value <= 1 falls back to the legacy per-path delivery. |
|
|
|
|
Ceiling on total registered arbitrage paths, applied before discovery runs so a discovery-heavy skip-fest stops instead of registering millions. 0 means uncapped. |
|
|
|
|
Seconds between registration-progress summaries, which fire on the interval even when the path count never crosses a discovery_batch_size boundary. 0 emits on every update. |
dispatch¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Capture profit through an ERC-6909 vault claim instead of a plain transfer; |
|
|
|
|
Driver-side profit floor in basis points (1/100 of a percent) applied at the simulation seam before a candidate is dispatched. A floor is a magnitude, so the key is unsigned end to end: a negative value is refused by the layer that supplied it, not clamped into a silent second default. This is NOT solve.min_profit_wei, which is the core’s own floor: the two arms of the simulation seam are measured against their own floors, so naming one does not size the other. |
|
|
|
|
Directory holding the executor runtime bytecode file the sim injects; unset falls through to the source-layout candidate the driver computes, and a wheel install must set it (or pass the file path explicitly). |
strategy.settlement¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Activate the settled-block settlement arm in this process; inactive leaves the facet dormant. |
|
|
|
|
Comma-separated broadcast endpoints for settlement submissions. Restricted to the pinned revert-protecting relay allowlist (docs/autonomous-user-journey/RELAYS_AND_GUARDRAILS.md). |
strategy.mevblocker_backrun¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Activate this per-ecosystem backrun arm in this process; inactive leaves the facet dormant. |
|
|
|
|
Explicit bid-mode flag; off is observe-only. Bid mode also requires a non-zero budget_wei (the legality gate reads both). |
|
|
|
|
Cumulative bid budget cap in wei (decimal text; TOML: quoted string). Zero makes bid mode illegal; the spent accumulator tracks the wallet’s gas burn. |
|
|
|
|
Hard per-submission cap in wei (decimal text; TOML: quoted string); a decided bid is clamped to it. |
|
|
|
|
The builder’s bribe share of true profit in bips of 10_000 — the competitiveness ceiling (clamped at the site to <= 10_000). |
|
|
|
|
The operator’s priority fee in gwei, converted to wei when pricing the wallet’s gas burn. |
|
|
|
|
Composed-bundle gas estimate priced into the net-of-gas bid gate until an exact in-scratch measurement replaces it. |
|
|
|
|
The envelope gate’s profit floor in wei: a declared chain whose solver bound tops out below this is skipped without a simulation. Default 1 wei = solve everything and let the net-of-gas bid gate decide; raise to pre-filter thin cycles. |
|
|
`VerifyTicks(Strict |
Bootstrap |
Off)` |
|
|
|
|
Sign-nothing dispatch: every candidate skips as DryRun. Plain bool words are accepted. |
|
|
|
|
Hex secp256k1 operator key file. Unset means no signing material is loaded (observe-only); the key never leaves TxSigner. |
|
|
|
|
Executor contract address the composed backrun calls; parsed and validated at the driver boot. |
|
|
|
|
Executor owner / sim caller address. Unset falls back to the legacy EXECUTOR_OWNER_ADDRESS env name, then the built-in default; parsed at the driver boot. |
|
|
|
|
Bundle-sim endpoint serving eth_callMany. Unset reuses the chain node; MEVBlocker’s /fast tier answers method-missing, so the node is the fallback. |
|
|
|
|
Run the live deep-pair ranking sanity probe before any frame trusts the connector-depth truncation (diagnostic). |
|
|
|
|
Discovery fan-out cap: the maximum number of WETH-entry cycles admitted per frame (strongest by touched-pool count). |
|
|
|
|
Hop-depth cap per admitted cycle: the WETH stake pin plus up to cycle_max_hops - 1 connectors (cycle length in pools). Minimum 2 (one pin + one connector); a lower value fails the load. Distinct from |
|
|
|
|
Offline dry-run’s pinned head block: replays captured frames against the chain view they were pending in instead of the live tip. Unset falls back to the fetched head. |
|
|
|
|
Kill-switch path: while the file exists the decision layer drops every candidate and the loop halts. |
|
|
|
|
MEVBlocker searcher WebSocket for the private bundle broadcast (single URL). |
|
|
|
|
Private-broadcast RPC for the raw relay fan-out. Set arms the private-broadcast arm: the signed backrun goes raw to this endpoint first, then to the chain node as the public fallback relay. |
strategy.txpool_backrun¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Activate this per-ecosystem backrun arm in this process; inactive leaves the facet dormant. |
|
|
|
|
Explicit bid-mode flag; off is observe-only. Bid mode also requires a non-zero budget_wei (the legality gate reads both). |
|
|
|
|
Cumulative bid budget cap in wei (decimal text; TOML: quoted string). Zero makes bid mode illegal; the spent accumulator tracks the wallet’s gas burn. |
|
|
|
|
Hard per-submission cap in wei (decimal text; TOML: quoted string); a decided bid is clamped to it. |
|
|
|
|
The builder’s bribe share of true profit in bips of 10_000 — the competitiveness ceiling (clamped at the site to <= 10_000). |
|
|
|
|
The operator’s priority fee in gwei, converted to wei when pricing the wallet’s gas burn. |
|
|
|
|
Composed-bundle gas estimate priced into the net-of-gas bid gate until an exact in-scratch measurement replaces it. |
|
|
|
|
The envelope gate’s profit floor in wei: a declared chain whose solver bound tops out below this is skipped without a simulation. Default 1 wei = solve everything and let the net-of-gas bid gate decide; raise to pre-filter thin cycles. |
|
|
`VerifyTicks(Strict |
Bootstrap |
Off)` |
|
|
|
|
Sign-nothing dispatch: every candidate skips as DryRun. Plain bool words are accepted. |
|
|
|
|
Hex secp256k1 operator key file. Unset means no signing material is loaded (observe-only); the key never leaves TxSigner. |
|
|
|
|
Executor contract address the composed backrun calls; parsed and validated at the driver boot. |
|
|
|
|
Executor owner / sim caller address. Unset falls back to the legacy EXECUTOR_OWNER_ADDRESS env name, then the built-in default; parsed at the driver boot. |
|
|
|
|
Bundle-sim endpoint serving eth_callMany. Unset reuses the chain node; MEVBlocker’s /fast tier answers method-missing, so the node is the fallback. |
|
|
|
|
Run the live deep-pair ranking sanity probe before any frame trusts the connector-depth truncation (diagnostic). |
|
|
|
|
Discovery fan-out cap: the maximum number of WETH-entry cycles admitted per frame (strongest by touched-pool count). |
|
|
|
|
Hop-depth cap per admitted cycle: the WETH stake pin plus up to cycle_max_hops - 1 connectors (cycle length in pools). Minimum 2 (one pin + one connector); a lower value fails the load. Distinct from |
|
|
|
|
Offline dry-run’s pinned head block: replays captured frames against the chain view they were pending in instead of the live tip. Unset falls back to the fetched head. |
|
|
|
|
Kill-switch path: while the file exists the decision layer drops every candidate and the loop halts. |
|
|
|
|
Comma-separated public relay fan-out endpoints for raw backrun broadcast, with the read provider as fallback. |
aave¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
In-tree bridge-probe observation surface in the arbitrage simulator (presence gates). |
offline¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
RPC URL for the offline CL capture/boundary-scan examples (network-gated). |
|
|
|
|
Pinned block for the CL capture generator. |
|
|
|
|
Max active-set fetches backfilled by the CL capture generator. |
|
|
|
|
Per-block path cap for the CL capture generator. |
|
|
|
|
Block for the CL boundary-scan examples. |
|
|
|
|
Database path for the standalone-consumer fixture example. |
|
|
|
|
Network-gated V3 IIA fixture reproduction RPC endpoint (test-only). |
|
|
|
|
Network-gated V3 IIA fixture reproduction block (test-only). |
test_hooks¶
Env var |
TOML key |
Type |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Allocation-tracking gate for the math/pools bench suites ( |
|
|
|
|
Block-pump self-abort hatch (presence gates in tests). |
|
|
|
|
Default-ON flag-parse probe (asserted by the bot-core unit tests). |