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:
ArbitrageConfig— the unified frozen config value object (built from the resolved verdict + CLI flags viaArbitrageConfig.build(); the operator/executor identity it carries is read from the process environment; the deployment defaults and the checksum helper live indegenbot.runner.identity).
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 forArbitrageConfig.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
nodefills 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.
- 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 ontomain()lives in theBotRunnerorchestration. The operational stances resolve through the core verdict, and the operator/executor identity is read from the process environment. Live defaults reproducemain()’s behavior exactly — no new defaults invented.- verification_retry_policy: degenbot.arbitrage.RetryPolicy¶
- 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 everyDEGENBOT_*operational stance is a declared schema key that arrives fromdegenbot.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 (explicitnode> OS envDEGENBOT_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 raisesRpcNotConfiguredError.executor: zero address is a fatal
ValueError(a factory cannot return early likemain()’sreturn).inject code: when
simulation.inject_executor_coderesolves true, the executor address is overridden toINJECTED_EXECUTOR_ADDRESS.permutation: a CLI string becomes a singleton frozenset;
NonestaysNone.
- Returns:
A frozen
ArbitrageConfigwith cascade-resolvednode_http/node_ws.- Raises:
ValueError – missing or placeholder operator in live mode, zero-address executor, a retired knob present, or
RpcNotConfiguredError(aValueErrorsubclass) when no RPC endpoint is configured forchain_idin any cascade layer.