Context
Bot-level knobs, per-chain RPC endpoints, per-protocol addresses, and flash-loan sources all live in a TOML file. Secrets (RPC URLs) are referenced via ${ENV_VAR} placeholders and substituted from the environment at load time — no secrets ever in the repo.
Scope
Config struct hierarchy: bot, chain, protocol, flashloan, liquidator
- Hash-map keyed sections so adding chains / protocols later is a config edit, not a schema change
Config::load(path) — reads → substitutes env vars → parses via serde
- Hand-rolled
substitute_env_vars() helper that errors cleanly on unset vars
config/default.toml with real BSC addresses (Venus comptroller, Aave V3 Pool)
.env.example documenting BNB_WS_URL and BNB_HTTP_URL
Acceptance criteria
References
- Delivered in commit
2495292
- PRD section 4d (Config Loader)
Context
Bot-level knobs, per-chain RPC endpoints, per-protocol addresses, and flash-loan sources all live in a TOML file. Secrets (RPC URLs) are referenced via
${ENV_VAR}placeholders and substituted from the environment at load time — no secrets ever in the repo.Scope
Configstruct hierarchy:bot,chain,protocol,flashloan,liquidatorConfig::load(path)— reads → substitutes env vars → parses via serdesubstitute_env_vars()helper that errors cleanly on unset varsconfig/default.tomlwith real BSC addresses (Venus comptroller, Aave V3 Pool).env.exampledocumentingBNB_WS_URLandBNB_HTTP_URLAcceptance criteria
Config::load(path)returnsanyhow::Result<Config>config/default.tomlparses with a populated.env(copied from.env.example)References
2495292