Expand description
Configuration management.
Handles loading, merging, and validation of configuration from multiple sources (CLI args, environment variables, config files).
§Configuration Management
This module handles loading, merging, and validating configuration from multiple sources with the following priority (highest to lowest):
- CLI arguments
- Environment variables (
SCOPE_*prefix) - User config file (
~/.scope-bca/config.yaml) - Built-in defaults
§Configuration File Format
chains:
# EVM-compatible chains
ethereum_rpc: "https://mainnet.infura.io/v3/YOUR_KEY"
bsc_rpc: "https://bsc-dataseed.binance.org"
# Non-EVM chains
solana_rpc: "https://api.mainnet-beta.solana.com"
tron_api: "https://api.trongrid.io"
api_keys:
etherscan: "YOUR_API_KEY"
bscscan: "YOUR_API_KEY"
solscan: "YOUR_API_KEY"
tronscan: "YOUR_API_KEY"
output:
format: table # table, json, csv, markdown
color: true
address_book:
data_dir: "/Users/me/scope-address-book" # optional; absolute path
ghola:
enabled: false # route HTTP through Ghola sidecar
stealth: false # apply temporal drift + ghost signing
buffer_size: 4096 # read buffer for large response headers
market:
health: # order book health thresholds; omitted keys keep defaults
min_levels: 10 # valid levels (price > 0, qty > 0) per side
max_spread_pct: 3.0 # best bid/ask spread, % of mid
min_top3_depth: 300
min_top10_depth: 2000
min_depth: 3000 # total in-band depth per side
peg_target: 1.0
peg_range: 0.001
min_bid_ask_ratio: 0.2
max_bid_ask_ratio: 5.0
depth_window_pct: 2.0 # depth/volume rule: depth within ±2% of mid
min_depth_volume_pct: 5.0 # below 5% of 24h volume fails
max_depth_volume_pct: 10.0 # above 10% of 24h volume warns§Error Handling
Configuration errors are wrapped in ScopeError::Config and include
context about which source caused the failure.
Structs§
- Address
Book Config - Address book configuration.
- Alert
Config - Alert configuration for price and whale detection.
- Chains
Config - Blockchain client configuration.
- Config
- Application configuration.
- Export
Config - CSV export configuration.
- Ghola
Config - Ghola sidecar configuration.
- Market
Config - Market analysis configuration.
- Monitor
Config - Monitor-specific configuration.
- Output
Config - Output formatting configuration.
- WebConfig
- Web server configuration.
- Widget
Visibility - Controls which widgets are visible in the monitor.
Enums§
- Color
Scheme - Color scheme for the monitor TUI.
- Layout
Preset - Layout preset for the monitor TUI.
- Output
Format - Available output formats for analysis results.
- Scale
Mode - Y-axis scaling mode for price charts.
Constants§
- DEFAULT_
MONITOR_ REFRESH_ SECS - Default refresh interval in seconds.