ScreenerBot
DocsDashboard GuidesEvents

Events Monitoring

Comprehensive event logging and system activity tracking with structured data, real-time streaming, and powerful filtering capabilities.

Overview

The events system provides structured logging of all significant activities in ScreenerBot. Events are stored in a dedicated database and can be queried, filtered, and analyzed through the dashboard for debugging, auditing, and performance monitoring.

Structured Logging:

JSON metadata with category, severity, and context

Real-Time Stream:

Real-time event capture without performance impact

30-Day Retention:

Automatic cleanup with SQLite persistence

Event Categories

Trading Events

  • Entry: Position opens, buy executions
  • Position: P&L changes, exit events
  • Trader: Start/stop, mode changes
  • Swap: Attempts, successes, failures

Data Events

  • Token: Discovery, updates, blacklisting
  • Filtering: Evaluations, pass/reject
  • Pool: Discovery, price updates
  • OHLCV: Data fetches, gaps detected

System Events

  • System: Startup, shutdown, config
  • API: External calls, rate limits
  • Connectivity: RPC health, failures
  • Security: Checks, risk assessments

Transaction Events

  • Transaction: On-chain operations
  • Confirmations and finality
  • Failed transaction analysis
  • Signature tracking

Security Events

  • Security: Rugcheck results, risk detection
  • API: Key leaks, abuse detection
  • Access: Unusual login attempts, IP blacklisting
  • Data: Exfiltration attempts, integrity checks

Severity Levels

Event Importance Classification

Events are categorized by severity to help prioritize attention and filter noise.

Critical

System failures requiring immediate attention

Error

Operation failures with impact

Warning

Issues that should be reviewed

Info

Normal operational events

Debug

Detailed diagnostics (when enabled)

Event Structure

Structured Event Data

Each event contains comprehensive metadata for filtering, analysis, and debugging.

Timestamp:

Precise event time (microsecond precision) for ordering and correlation

Category:

Event type classification (Trading, System, Data, Transaction)

Severity:

Importance level (Critical, Error, Warning, Info, Debug)

Message:

Human-readable description of what happened

Context:

Additional metadata in JSON format (IDs, amounts, errors)

Source:

Module/component that generated the event

Example Context: {"token": "Dz9mQ...", "amount_sol": 0.5, "roi": 2.5, "strategy": "momentum"}

Dashboard Features

Event Monitoring Interface

Real-Time Stream

  • Last 100 events auto-refreshing
  • Color-coded by severity
  • Expandable event details
  • Full JSON context display

Filtering Options

  • Filter by category (multi-select)
  • Filter by severity level
  • Search by message content
  • Time range selection

Export Capabilities

  • Export as JSON (full context)
  • Export as CSV (tabular format)
  • Custom date range export
  • Filtered export (only selected events)

Event Details

  • Click to expand full context
  • Pretty-printed JSON viewer
  • Copy event ID/context
  • Related events linking

Event Statistics

Aggregate Metrics & Trends

Event Volume

  • • Events per category (24h/7d/30d)
  • • Total events by severity
  • • Events per hour chart
  • • Busiest time periods

Error Tracking

  • • Error rate trends
  • • Most frequent error types
  • • Error spikes detection
  • • Recovery time metrics

System Health

  • • Critical events in last 24h
  • • Service uptime indicators
  • • Performance degradation alerts
  • • Resource usage events

Alerting: Set up custom alerts for critical events or unusual patterns (e.g., error rate spike, repeated failures, service downtime).

Data Persistence

High-Performance Event Storage

Events are stored in SQLite database (data/events.db) with automatic cleanup after 30 days.

Real-Time Logging:

Events captured immediately without impacting performance

Persistent Storage:

All events saved to database for historical analysis

30-Day Retention:

Automatic cleanup removes old events

Fast Filtering:

Quickly search by timestamp, category, and severity

Use Cases

Practical Applications

Debugging & Troubleshooting

Trace issues through event timeline. Search for errors around specific timestamps, follow event chains to understand failure cascades, and identify root causes with full context data.

Performance Monitoring

Track system performance by analyzing event frequency, response times in context data, and resource usage patterns. Identify bottlenecks and optimization opportunities.

Auditing & Compliance

Maintain comprehensive audit trail of all trading activities. Export events for external auditing, compliance reporting, or tax documentation purposes.

System Health Monitoring

Monitor system health through event statistics. Detect anomalies, track error rates over time, and receive alerts for critical events requiring immediate attention.

Trading Analysis

Review trading decisions and their outcomes. Analyze entry/exit events, compare strategy performance, and identify patterns in successful vs failed trades.

API Usage Tracking

Monitor external API calls, rate limit hits, and response times. Optimize API usage and identify when to upgrade plans or switch endpoints.