ScreenerBot
DocsDashboard GuidesServices

Service Management

Monitor and control all ScreenerBot background services with real-time health checks, performance metrics, and dependency management.

Overview

ScreenerBot operates as a collection of independent background services that handle different aspects of the system. The Service Manager orchestrates startup, shutdown, health monitoring, and dependency resolution for seamless operation.

18 Services:

Data, Trading, Monitoring, Infrastructure services

Dependency Resolution:

Automatic startup ordering with topological sort

Health Monitoring:

Real-time status tracking with degradation detection

Core Services

Data Services

Token and pool data management

  • Tokens Service: Discovery and database management
  • Pools Service: DEX pool monitoring and orchestration
  • Pool Discovery: Multi-source pool detection
  • Pool Fetcher: DEX pool data monitoring
  • Pool Calculator: Real-time price computation
  • Pool Analyzer: Liquidity analysis

Trading Services

Automated trading and position management

  • Trader Service: Automated trading orchestration
  • Positions Service: Position tracking and verification
  • Filtering Service: Token filtering engine

Monitoring Services

Monitoring Services

Real-time tracking and analytics

  • Transactions Service: On-chain activity monitoring
  • OHLCV Service: Candlestick data collection
  • Wallet Service: Balance tracking and snapshots
  • Events Service: Structured event logging

Infrastructure Services

Core system utilities

  • SOL Price Service: Real-time SOL/USD price
  • RPC Stats Service: RPC usage tracking
  • ATA Cleanup Service: Empty account cleanup
  • Webserver: Dashboard and API endpoints

Service Lifecycle

Orchestrated Startup & Shutdown

Startup Sequence

Services start in dependency order using topological sort to ensure prerequisites are ready.

1
Infrastructure

Events, RPC Stats, SOL Price

2
Data Services

Tokens, Pools, Pool sub-services

3
Monitoring

Transactions, OHLCV, Wallet

4
Trading

Filtering, Positions, Trader

5
Web Interface

Webserver dashboard

Shutdown Sequence

Services shutdown in reverse order to ensure clean state. Each service completes pending operations before stopping.

  • Graceful stop signals sent
  • Pending tasks complete
  • Resources released properly
  • State persisted to disk
  • Dependencies shutdown last

Health Monitoring

Service Health Status

Each service reports health status for proactive monitoring and issue detection.

Healthy

Operating normally with no issues

Degraded

Operating with warnings or issues

Unhealthy

Critical failures detected

Starting

Initialization in progress

Stopped

Not currently running

Performance Metrics

Real-Time Service Metrics

Performance metrics collected continuously for each service.

CPU Time:

Total busy time and idle time per task worker

Poll Times:

Min, max, and mean polling duration statistics

Task Counts:

Total tasks spawned and currently active

Memory Usage:

Per-service memory allocation tracking

Work Backlog:

Pending work items being processed

Throughput:

Operations per second

Performance Metrics

Real-Time Service Metrics

Performance metrics collected continuously for each service.

CPU Time:

Total busy time and idle time per task worker

Poll Times:

Min, max, and mean polling duration statistics

Task Counts:

Total tasks spawned and currently active

Memory Usage:

Per-service memory allocation tracking

Work Backlog:

Pending work items being processed

Throughput:

Operations per second

Real-Time Monitoring: Metrics collected continuously for accurate performance tracking.

Dashboard Features

Service Management Interface

Status Overview

  • All services with status indicators
  • Health checks and uptime tracking
  • Real-time status updates
  • Color-coded health badges

Performance Tracking

  • Performance metrics visualization
  • CPU and memory usage charts
  • Task count and work backlog
  • Throughput statistics

Dependency Graph

  • Visual service dependency tree
  • Startup order visualization
  • Impact analysis for failures
  • Priority level indicators

Logs & Events

  • Per-service event filtering
  • Recent service events
  • Error and warning summaries
  • Quick link to full event logs

Troubleshooting

Common Service Issues

Service Won't Start

  • • Check dependency services are running (see dependency graph)
  • • Review startup logs in Events dashboard
  • • Verify configuration file is valid (config/services section)
  • • Ensure no port conflicts (webserver)

Degraded Status

  • • Review recent events for warning messages
  • • Check external API rate limits (tokens, pools services)
  • • Verify RPC endpoint health (connectivity service)
  • • Monitor work backlog for delays

High CPU Usage

  • • Check task metrics - high task counts may indicate loop issues
  • • Review poll times - excessive polling can cause CPU spikes
  • • Monitor work backlog - delays indicate need for optimization
  • • Reduce update frequencies in configuration if needed

Service Crashes

  • • Review error logs immediately before crash timestamp
  • • Check for panic messages in terminal output
  • • Verify database files are not corrupted
  • • Restart bot completely - some services have initialization dependencies