Skip to main content

Module config

Module config 

Source
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):

  1. CLI arguments
  2. Environment variables (SCOPE_* prefix)
  3. User config file (~/.scope-bca/config.yaml)
  4. 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§

AddressBookConfig
Address book configuration.
AlertConfig
Alert configuration for price and whale detection.
ChainsConfig
Blockchain client configuration.
Config
Application configuration.
ExportConfig
CSV export configuration.
GholaConfig
Ghola sidecar configuration.
MarketConfig
Market analysis configuration.
MonitorConfig
Monitor-specific configuration.
OutputConfig
Output formatting configuration.
WebConfig
Web server configuration.
WidgetVisibility
Controls which widgets are visible in the monitor.

Enums§

ColorScheme
Color scheme for the monitor TUI.
LayoutPreset
Layout preset for the monitor TUI.
OutputFormat
Available output formats for analysis results.
ScaleMode
Y-axis scaling mode for price charts.

Constants§

DEFAULT_MONITOR_REFRESH_SECS
Default refresh interval in seconds.