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)

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

Structs§

ActiveAlert
An active (currently firing) alert with a description.
AlertConfig
Alert configuration for price and whale detection.
ColorPalette
Named color palette derived from a ColorScheme.
DataPoint
A data point with timestamp, value, and whether it’s real (from API) or synthetic.
ExportConfig
CSV export configuration.
MonitorApp
Main monitor application, generic over terminal backend for testability.
MonitorArgs
Arguments for the top-level monitor command.
MonitorConfig
Monitor-specific configuration.
MonitorState
State for the live token monitor.
OhlcCandle
OHLC (Open-High-Low-Close) candlestick data for a time period.
WidgetVisibility
Controls which widgets are visible in the monitor.

Enums§

ChartMode
Chart display mode.
ColorScheme
Color scheme for the monitor TUI.
LayoutPreset
Layout preset for the monitor TUI.
ScaleMode
Y-axis scaling mode for price charts.
TimePeriod
Time period for chart display (limited to 24 hours of data retention).

Functions§

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