degenbot.runner.config¶

Driver configuration for the settlement-arbitrage BotRunner.

This module owns the Python-companion, stays-python surface that the runtime driver (BotRunner) and its tests consume:

The display renderers (sim-diag / sim-fail / failure-breakdown) live in degenbot.runner._render. The thin-margin solver-result pre-filter of the legacy main() path is core-owned: the drop lives in the Rust dispatch leaf alongside its basis-points denominator and candidate tuple, so this module carries no filtering state.

Module Contents¶

class degenbot.runner.config.RpcCascadeOverrides¶

The degenbot.config.resolve_rpc_uris() inputs for ArbitrageConfig.build().

The chain identity and the explicit-override endpoint travel together: they are exactly the arguments the RPC cascade consumes, so bundling them keeps the factory’s keyword surface one concept per parameter. One node fills one transport slot and the core classifies which, so a driver that needs both an HTTP and a WS endpoint declares one of them here and takes the other from the file or the environment.

chain_id: int = 1¶
node: str | None = None¶
class degenbot.runner.config.ArbitrageConfig¶

Unified settlement-arbitrage configuration — one object for the ~20 tunables main() reads.

Replaces the scattered config sources (the example’s dotenv file, module-top constants, and CLI flags) with a single frozen value object. Construct via build(); the bridge onto main() lives in the BotRunner orchestration. The operational stances resolve through the core verdict, and the operator/executor identity is read from the process environment. Live defaults reproduce main()’s behavior exactly — no new defaults invented.

operator_address: str¶
operator_private_key: str¶
chain_id: int¶
node_http: str¶
node_ws: str¶
executor_address: str¶
executor_owner: str¶
inject_executor_code: bool¶
injected_address: str¶
permutation_filter: frozenset[str] | None¶
verification_retry_policy: degenbot.arbitrage.RetryPolicy¶
erc6909_profit: bool¶
reg_progress_secs: float¶
max_registered_paths: int¶
discovery_batch_size: int¶
contracts_dir: str¶
sim_exit_on_fail: bool¶
sim_exit_ignore_buckets: str¶
dry_run: bool¶
diag: degenbot.runner.diag.DiagConfig¶
executor_runtime: str | pathlib.Path | None = None¶
classmethod build(*, live: bool, permutation: str | None, rpc: RpcCascadeOverrides | None = None, values: degenbot.config.ConfigValues | None = None) → ArbitrageConfig¶

Build an ArbitrageConfig from the resolved verdict + CLI flags + process identity.

The dotenv file is no longer a source: operator/executor identity is read from the process environment (the launch shell exports it from bot.env), and every DEGENBOT_* operational stance is a declared schema key that arrives from degenbot.config.resolved_config() and reaches the operator file as well as the environment; nothing here re-resolves a layer.

Behavior: - operator: live mode requires both OPERATOR_ADDRESS/OPERATOR_PRIVATE_KEY

from the process environment and refuses a known placeholder key (raises ValueError); dry-run defaults to a valid throwaway key + its derived address.

  • nodes: delegated to degenbot.config.resolve_rpc_uris(), so the four-layer cascade (explicit node > OS env DEGENBOT_RPC_{IPC,WS,HTTP}_CHAINID_{cid} > the operator file’s [nodes.*] tables > a declared default) applies, per capability. There is no ``localhost`` default — a chain with no configured endpoint in any layer raises RpcNotConfiguredError.

  • executor: zero address is a fatal ValueError (a factory cannot return early like main()’s return).

  • inject code: when simulation.inject_executor_code resolves true, the executor address is overridden to INJECTED_EXECUTOR_ADDRESS.

  • permutation: a CLI string becomes a singleton frozenset; None stays None.

Returns:

A frozen ArbitrageConfig with cascade-resolved node_http/node_ws.

Raises:

ValueError – missing or placeholder operator in live mode, zero-address executor, a retired knob present, or RpcNotConfiguredError (a ValueError subclass) when no RPC endpoint is configured for chain_id in any cascade layer.