# chopra2007/openclaw--stockticker-signals-discord-bot architecture

> Architecture diagram of the GitHub repository chopra2007/openclaw--stockticker-signals-discord-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chopra2007/openclaw--stockticker-signals-discord-bot
- Repository: https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot
- Video tour (about a minute): https://gitdiagram.com/chopra2007/openclaw--stockticker-signals-discord-bot/video

## Overview

Stock Signals is a self-hosted stock-research and Discord alert system. Its principal workflow is to receive an analyst or scanner signal, send a fast alert, then gather independent research and deliver supporting evidence; saved alert outcomes power performance and ranking commands. The graph also preserves the documented whole-market, options, video, and health capabilities. Relationships rely on README workflow statements and SOURCE INDEX references; unsampled subsystems are represented at their listed directory paths.

Main entry points: [`consensus_engine/main.py`](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/main.py) (Signal Engine), [`consensus_engine/cross_reference.py`](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/cross_reference.py) (Cross-Source Research), [`consensus_engine/alerts/commands.py`](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/alerts/commands.py) (Discord Commands), [`consensus_engine/llm_client.py`](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/llm_client.py) (LLM Fallback Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Signal Intake"]
  node_scanners["Market Scanners"]
  node_video["YouTube Research<br/>[youtube.py]"]
  node_engine["Signal Engine<br/>[main.py]"]
end

subgraph group_research["Research And Scoring"]
  node_crossref["Cross-Source Research<br/>[cross_reference.py]"]
  node_technical["Technical Analysis<br/>[technical.py]"]
  node_options["Options Intelligence<br/>[options.py]"]
  node_sec["SEC Filings<br/>[sec_edgar.py]"]
  node_precision["Precision Scoring<br/>[engine.py]"]
  node_all["All-Source Summary<br/>[aggregator.py]"]
  node_llm["LLM Fallback Client<br/>[llm_client.py]"]
end

subgraph group_delivery["Discord Experience"]
  node_discord["Two-Phase Alerts<br/>[discord.py]"]
  node_commands["Discord Commands<br/>[commands.py]"]
  node_briefing["Market Briefing<br/>[alfred.py]"]
end

subgraph group_measurement["Outcomes And Health"]
  node_db[("SQLite State<br/>[db.py]")]
  node_measurement["Alert Measurement<br/>[measurement.py]"]
  node_health["Source Health<br/>[health.py]"]
end

subgraph group_foundation["Shared Foundation"]
  node_config["Configuration<br/>[config.py]"]
  node_models["Signal Models<br/>[models.py]"]
  node_http["HTTP Session<br/>[http.py]"]
  node_rate["Rate Limiting<br/>[rate_limiter.py]"]
end

node_analyst(("Analyst Feed"))
node_discord_service["Discord"]
node_market_sources["External Market Sources"]
node_llm_service["Model Providers"]

node_analyst -->|"submits calls"| node_engine
node_scanners -->|"provides signals"| node_engine
node_video -->|"provides calls"| node_engine
node_engine -->|"sends fast alert"| node_discord
node_engine -->|"starts cross-check"| node_crossref
node_crossref -->|"gathers analysis"| node_technical
node_crossref -->|"gathers options"| node_options
node_crossref -->|"gathers filings"| node_sec
node_engine -->|"scores signals"| node_precision
node_crossref -->|"supplies follow-up"| node_discord
node_all -->|"synthesizes research"| node_llm
node_commands -->|"routes !all"| node_all
node_commands -->|"routes on-demand scan"| node_crossref
node_briefing -->|"delivers briefing"| node_discord
node_engine -->|"records outcomes"| node_measurement
node_measurement -->|"stores results"| node_db
node_commands -->|"reads performance"| node_db
node_commands -->|"reports freshness"| node_health
node_engine -->|"loads settings"| node_config
node_engine -->|"uses signal types"| node_models
node_crossref -->|"reads stored data"| node_db
node_technical -->|"fetches data"| node_http
node_sec -->|"fetches filings"| node_http
node_sec -->|"limits requests"| node_rate
node_llm -->|"posts completions"| node_http
node_llm -->|"paces providers"| node_rate
node_discord -->|"posts alerts"| node_discord_service
node_scanners -->|"reads feeds"| node_market_sources
node_llm -->|"requests completions"| node_llm_service

click node_scanners "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/tree/master/consensus_engine/scanners"
click node_video "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/scanners/youtube.py"
click node_engine "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/main.py"
click node_crossref "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/cross_reference.py"
click node_technical "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/analysis/technical.py"
click node_options "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/scanners/options.py"
click node_sec "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/scanners/sec_edgar.py"
click node_precision "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/engine.py"
click node_all "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/alerts/all_command/aggregator.py"
click node_llm "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/llm_client.py"
click node_discord "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/alerts/discord.py"
click node_commands "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/alerts/commands.py"
click node_briefing "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/briefing/alfred.py"
click node_db "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/db.py"
click node_measurement "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/measurement.py"
click node_health "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/health.py"
click node_config "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/config.py"
click node_models "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/models.py"
click node_http "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/utils/http.py"
click node_rate "https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/utils/rate_limiter.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_scanners,node_video,node_engine toneBlue
class node_crossref,node_technical,node_options,node_sec,node_precision,node_all,node_llm toneAmber
class node_discord,node_commands,node_briefing toneMint
class node_db,node_measurement,node_health toneRose
class node_config,node_models,node_http,node_rate,node_analyst,node_discord_service,node_market_sources,node_llm_service toneIndigo
```

## Components

### Signal Intake

- [Market Scanners](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/tree/master/consensus_engine/scanners): `consensus_engine/scanners`
- [YouTube Research](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/scanners/youtube.py): `consensus_engine/scanners/youtube.py`
- [Signal Engine](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/main.py): `consensus_engine/main.py`

### Research And Scoring

- [Cross-Source Research](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/cross_reference.py): `consensus_engine/cross_reference.py`
- [Technical Analysis](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/analysis/technical.py): `consensus_engine/analysis/technical.py`
- [Options Intelligence](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/scanners/options.py): `consensus_engine/scanners/options.py`
- [SEC Filings](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/scanners/sec_edgar.py): `consensus_engine/scanners/sec_edgar.py`
- [Precision Scoring](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/engine.py): `consensus_engine/engine.py`
- [All-Source Summary](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/alerts/all_command/aggregator.py): `consensus_engine/alerts/all_command/aggregator.py`
- [LLM Fallback Client](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/llm_client.py): `consensus_engine/llm_client.py`

### Discord Experience

- [Two-Phase Alerts](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/alerts/discord.py): `consensus_engine/alerts/discord.py`
- [Discord Commands](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/alerts/commands.py): `consensus_engine/alerts/commands.py`
- [Market Briefing](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/briefing/alfred.py): `consensus_engine/briefing/alfred.py`

### Outcomes And Health

- [SQLite State](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/db.py): `consensus_engine/db.py`
- [Alert Measurement](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/measurement.py): `consensus_engine/measurement.py`
- [Source Health](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/health.py): `consensus_engine/health.py`

### Shared Foundation

- [Configuration](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/config.py): `consensus_engine/config.py`
- [Signal Models](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/models.py): `consensus_engine/models.py`
- [HTTP Session](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/utils/http.py): `consensus_engine/utils/http.py`
- [Rate Limiting](https://github.com/chopra2007/openclaw--stockticker-signals-discord-bot/blob/master/consensus_engine/utils/rate_limiter.py): `consensus_engine/utils/rate_limiter.py`

### Other components

- **Analyst Feed**
- **Discord**
- **External Market Sources**
- **Model Providers**

## Connections

- Analyst Feed → Signal Engine: submits calls (evidence: `README.md`)
- Market Scanners → Signal Engine: provides signals (evidence: `README.md`)
- YouTube Research → Signal Engine: provides calls (evidence: `README.md`)
- Signal Engine → Two-Phase Alerts: sends fast alert (evidence: `README.md`)
- Signal Engine → Cross-Source Research: starts cross-check (evidence: `README.md`)
- Cross-Source Research → Technical Analysis: gathers analysis (evidence: `consensus_engine/cross_reference.py`)
- Cross-Source Research → Options Intelligence: gathers options (evidence: `consensus_engine/cross_reference.py`)
- Cross-Source Research → SEC Filings: gathers filings (evidence: `consensus_engine/cross_reference.py`)
- Signal Engine → Precision Scoring: scores signals (evidence: `consensus_engine/main.py`)
- Cross-Source Research → Two-Phase Alerts: supplies follow-up (evidence: `README.md`)
- All-Source Summary → LLM Fallback Client: synthesizes research (evidence: `consensus_engine/alerts/all_command/aggregator.py`)
- Discord Commands → All-Source Summary: routes !all (evidence: `consensus_engine/alerts/commands.py`)
- Discord Commands → Cross-Source Research: routes on-demand scan (evidence: `consensus_engine/alerts/commands.py`)
- Market Briefing → Two-Phase Alerts: delivers briefing (evidence: `consensus_engine/briefing/alfred.py`)
- Signal Engine → Alert Measurement: records outcomes (evidence: `consensus_engine/main.py`)
- Alert Measurement → SQLite State: stores results (evidence: `consensus_engine/db.py`)
- Discord Commands → SQLite State: reads performance (evidence: `consensus_engine/alerts/commands.py`)
- Discord Commands → Source Health: reports freshness (evidence: `consensus_engine/alerts/commands.py`)
- Signal Engine → Configuration: loads settings (evidence: `consensus_engine/main.py`)
- Signal Engine → Signal Models: uses signal types (evidence: `consensus_engine/main.py`)
- Cross-Source Research → SQLite State: reads stored data (evidence: `consensus_engine/cross_reference.py`)
- Technical Analysis → HTTP Session: fetches data (evidence: `consensus_engine/analysis/technical.py`)
- SEC Filings → HTTP Session: fetches filings (evidence: `consensus_engine/scanners/sec_edgar.py`)
- SEC Filings → Rate Limiting: limits requests (evidence: `consensus_engine/scanners/sec_edgar.py`)
- LLM Fallback Client → HTTP Session: posts completions (evidence: `consensus_engine/llm_client.py`)
- LLM Fallback Client → Rate Limiting: paces providers (evidence: `consensus_engine/llm_client.py`)
- Two-Phase Alerts → Discord: posts alerts (evidence: `README.md`)
- Market Scanners → External Market Sources: reads feeds (evidence: `README.md`)
- LLM Fallback Client → Model Providers: requests completions (evidence: `consensus_engine/llm_client.py`)
