Skip to main content

Module monitor

Module monitor 

Source
Expand description

§Live Token Monitor

This module implements a real-time terminal UI for monitoring token metrics. It displays live-updating charts for price, volume, transactions, and liquidity across four switchable layout presets with responsive terminal sizing.

§Usage

Directly from the command line (no interactive mode required):

scope monitor USDC
scope mon PEPE --chain ethereum --layout chart-focus --refresh 3
scope monitor 0x1234... -c solana -s log --color-scheme blue-orange

Or from interactive mode:

scope> monitor USDC
scope> mon 0x1234...

§Layout Presets

  • Dashboard – Charts top, gauges middle, transaction feed bottom (default)
  • ChartFocus – Full-width candles (~85%), minimal stats overlay below
  • Feed – Transaction log takes priority (~75%), small metrics + buy/sell on top
  • Compact – Price sparkline and metrics only, for small terminals (<80x24)
  • Exchange – Order book + chart + market info (exchange-style view)

The monitor auto-selects a layout based on terminal dimensions (responsive breakpoints). Manual switching via L/H disables auto-selection until A.

§Features

  • Real-time price chart (line, candlestick, or volume profile) with sliding window
  • Volume bar chart
  • Buy/sell ratio gauge
  • Scrollable activity feed (transaction log)
  • Key metrics panel with sparkline and stats table
  • Config-driven widget visibility (toggle any widget on/off)
  • Four layout presets switchable at runtime
  • Responsive terminal sizing with auto-layout
  • Log/linear Y-axis scale toggle
  • Three color schemes (Green/Red, Blue/Orange, Monochrome)
  • On-chain holder count integration (when chain client is available)
  • Per-pair liquidity depth breakdown across DEXes
  • Configurable price alerts (min/max thresholds, whale detection, volume spikes)
  • CSV export mode (toggle with E, writes to ./scope-exports/)
  • Auto-pause on user input (toggle with Shift+P)

§Keyboard Controls

  • Q/Esc quit, R refresh, P/Space pause
  • Shift+P toggle auto-pause on input
  • E toggle CSV export (REC indicator when active)
  • L/H cycle layout forward/backward
  • W + 1-5 toggle widget visibility
  • A re-enable auto layout
  • C toggle chart mode, S toggle log/linear scale, / cycle color scheme
  • T/Tab cycle time period, 1-6 select period
  • J/K scroll activity log, +/- adjust refresh speed

Re-exports§

pub use config::ChartMode;
pub use config::TimePeriod;
pub use input::MonitorApp;
pub use state::MonitorState;

Modules§

config
Configuration types, constants, and data structures for the monitor TUI.
input
MonitorApp struct and event handling for the monitor TUI.
state
Application state management for the monitor TUI.
widgets
Layout and rendering functions for the monitor TUI.

Structs§

AlertConfig
Alert configuration for price and whale detection.
ExportConfig
CSV export configuration.
MonitorArgs
Arguments for the top-level monitor command.
MonitorConfig
Monitor-specific configuration.
MonitorStart
What a monitor run watches and how it starts.
MonitorWatchArgs
The options of the monitor wizard (#47). The wizard turns the monitor arguments into a watchlist; these set its timing, outputs and checks.
WidgetVisibility
Controls which widgets are visible in the monitor.

Enums§

ColorScheme
Color scheme for the monitor TUI.
LayoutPreset
Layout preset for the monitor TUI.
ScaleMode
Y-axis scaling mode for price charts.

Constants§

DASHBOARD_DEPRECATED
Said when the old dashboard starts (#47, Q1).

Functions§

run
Entry point for the monitor command.
run_direct
Entry point for the top-level scope monitor command.