# kalwardin-dronzer/political_alpha_tracker architecture

> Architecture diagram of the GitHub repository kalwardin-dronzer/political_alpha_tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kalwardin-dronzer/political_alpha_tracker
- Repository: https://github.com/kalwardin-dronzer/political_alpha_tracker

## Overview

Political Alpha Tracker is a political-connection and alternative-data research pipeline for Indian equities. Operators refresh company and donor data, then run a daily scan that evaluates announcements and related signals, scores opportunities, manages paper positions, and sends Telegram alerts. The repository also documents factor research and backtesting, portfolio sizing, and weekly reporting. Several capabilities are documented but their runtime wiring is not visible in the excerpts; those links are omitted or marked unverified. The README describes procurement L1 monitoring, but the sampled orchestrator explicitly skips it because its data is mock.

Main entry points: [`src/pipeline/pipeline_orchestrator.py`](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/pipeline/pipeline_orchestrator.py) (Pipeline orchestrator), [`src/data/cache_manager.py`](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/cache_manager.py) (SQLite cache), [`refresh.py`](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/refresh.py) (Refresh runner), [`src/signals/alpha_engine.py`](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/alpha_engine.py) (Alpha engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Runtime entry points"]
  node_daily["Daily runner<br/>[main.py]"]
  node_refresh["Refresh runner<br/>[refresh.py]"]
  node_orchestrator["Pipeline orchestrator"]
  node_config["Configuration<br/>[config.py]"]
end

subgraph group_data["Universe and data"]
  node_watchlist["Watchlist funnel"]
  node_screener["Financial screener"]
  node_donors["Donor ingestion<br/>[donor_ingester.py]"]
  node_entity["Entity resolution<br/>[entity_resolver.py]"]
  node_mca["MCA director resolver<br/>[mca_resolver.py]"]
  node_cin["CIN resolver<br/>[cin_resolver.py]"]
  node_bse["BSE monitor<br/>[bse_monitor.py]"]
  node_cache[("SQLite cache<br/>[cache_manager.py]")]
end

subgraph group_signals["Signals and scoring"]
  node_graph["Political graph<br/>[graph_manager.py]"]
  node_alpha["Alpha engine<br/>[alpha_engine.py]"]
  node_insider["Insider tracker<br/>[insider_tracker.py]"]
  node_bulk["Bulk deal monitor"]
  node_technical["Technical analyzer"]
  node_factor["Factor engine<br/>[factor_engine.py]"]
  node_tender["Tender monitor<br/>[tender_monitor.py]"]
  node_pledge["Pledge monitor<br/>[pledge_monitor.py]"]
  node_policy["Policy monitor<br/>[policy_monitor.py]"]
  node_macro["Macro event monitor"]
  node_leadlag["Lead-lag analysis<br/>[lead_lag.py]"]
  node_volume["Volume tracker<br/>[volume_tracker.py]"]
end

subgraph group_execution["Portfolio and alerts"]
  node_portfolio["Portfolio manager"]
  node_notifier["Telegram notifier<br/>[notifier.py]"]
  node_tearsheet["Weekly tearsheet"]
end

subgraph group_research["Research and validation"]
  node_backtest["Event backtester<br/>[backtest.py]"]
  node_factorbacktest["Factor backtest<br/>[factor_backtest.py]"]
  node_price[("Price store<br/>[price_store.py]")]
end

node_operator(("Operator"))
node_telegram(("Telegram"))

node_operator -->|"runs"| node_daily
node_daily -->|"starts"| node_orchestrator
node_operator -->|"refreshes"| node_refresh
node_refresh -->|"regenerates"| node_watchlist
node_refresh -->|"refreshes directors"| node_mca
node_refresh -->|"resolves donors"| node_entity
node_refresh -->|"ingests"| node_donors
node_refresh -->|"sends summary"| node_notifier
node_watchlist -.->|"filters fundamentals"| node_screener
node_watchlist -.->|"persists candidates"| node_cache
node_donors -.->|"stores records"| node_cache
node_entity -.->|"resolves records"| node_cache
node_mca -.->|"stores directors"| node_cache
node_cin -.->|"resolves identifiers"| node_cache
node_orchestrator -->|"reads watchlist"| node_cache
node_orchestrator -->|"queries connections"| node_graph
node_orchestrator -.->|"scans announcements"| node_bse
node_orchestrator -.->|"processes events"| node_alpha
node_orchestrator -.->|"checks insider activity"| node_insider
node_orchestrator -.->|"checks bulk deals"| node_bulk
node_orchestrator -.->|"monitors tenders"| node_tender
node_orchestrator -.->|"checks pledges"| node_pledge
node_orchestrator -.->|"checks policy events"| node_policy
node_orchestrator -.->|"checks macro events"| node_macro
node_orchestrator -.->|"scans volume"| node_volume
node_alpha -->|"scores connections"| node_graph
node_graph -->|"loads company and donor data"| node_cache
node_alpha -->|"checks accumulation"| node_insider
node_alpha -->|"checks deals"| node_bulk
node_alpha -.->|"uses entry analysis"| node_technical
node_orchestrator -.->|"manages positions"| node_portfolio
node_orchestrator -.->|"sends alerts"| node_notifier
node_portfolio -->|"uses indicators"| node_technical
node_portfolio -->|"stores positions"| node_cache
node_notifier -->|"sends messages"| node_telegram
node_daily -->|"runs report"| node_tearsheet
node_tearsheet -->|"sends report"| node_notifier
node_backtest -->|"tests political signals"| node_graph
node_factorbacktest -.->|"evaluates factors"| node_factor
node_factorbacktest -.->|"uses price history"| node_price
node_backtest -.->|"uses stored data"| node_cache
node_daily -->|"loads settings"| node_config
node_refresh -.->|"loads settings"| node_config

click node_daily "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/main.py"
click node_refresh "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/refresh.py"
click node_orchestrator "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/pipeline/pipeline_orchestrator.py"
click node_watchlist "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/watchlist_generator.py"
click node_screener "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/financial_screener.py"
click node_donors "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/donor_ingester.py"
click node_entity "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/entity_resolver.py"
click node_mca "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/mca_resolver.py"
click node_cin "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/cin_resolver.py"
click node_bse "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/bse_monitor.py"
click node_cache "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/cache_manager.py"
click node_graph "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/graph_manager.py"
click node_alpha "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/alpha_engine.py"
click node_insider "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/insider_tracker.py"
click node_bulk "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/bulk_deal_monitor.py"
click node_technical "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/technical_analyzer.py"
click node_factor "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/factor_engine.py"
click node_tender "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/tender_monitor.py"
click node_pledge "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/pledge_monitor.py"
click node_policy "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/policy_monitor.py"
click node_macro "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/macro_event_monitor.py"
click node_leadlag "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/lead_lag.py"
click node_volume "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/volume_tracker.py"
click node_portfolio "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/execution/portfolio_manager.py"
click node_notifier "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/execution/notifier.py"
click node_tearsheet "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/execution/weekly_tearsheet.py"
click node_backtest "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/research/backtest.py"
click node_factorbacktest "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/research/factor_backtest.py"
click node_price "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/price_store.py"
click node_config "https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/config.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_daily,node_refresh,node_orchestrator,node_config toneBlue
class node_watchlist,node_screener,node_donors,node_entity,node_mca,node_cin,node_bse,node_cache toneAmber
class node_graph,node_alpha,node_insider,node_bulk,node_technical,node_factor,node_tender,node_pledge,node_policy,node_macro,node_leadlag,node_volume toneMint
class node_portfolio,node_notifier,node_tearsheet toneRose
class node_backtest,node_factorbacktest,node_price,node_operator,node_telegram toneIndigo
```

## Components

### Runtime entry points

- [Daily runner](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/main.py): `main.py`
- [Refresh runner](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/refresh.py): `refresh.py`
- [Pipeline orchestrator](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/pipeline/pipeline_orchestrator.py): `src/pipeline/pipeline_orchestrator.py`
- [Configuration](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/config.py): `src/config.py`

### Universe and data

- [Watchlist funnel](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/watchlist_generator.py): `src/data/watchlist_generator.py`
- [Financial screener](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/financial_screener.py): `src/data/financial_screener.py`
- [Donor ingestion](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/donor_ingester.py): `src/data/donor_ingester.py`
- [Entity resolution](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/entity_resolver.py): `src/data/entity_resolver.py`
- [MCA director resolver](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/mca_resolver.py): `src/data/mca_resolver.py`
- [CIN resolver](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/cin_resolver.py): `src/data/cin_resolver.py`
- [BSE monitor](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/bse_monitor.py): `src/data/bse_monitor.py`
- [SQLite cache](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/cache_manager.py): `src/data/cache_manager.py`

### Signals and scoring

- [Political graph](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/graph_manager.py): `src/signals/graph_manager.py`
- [Alpha engine](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/alpha_engine.py): `src/signals/alpha_engine.py`
- [Insider tracker](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/insider_tracker.py): `src/signals/insider_tracker.py`
- [Bulk deal monitor](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/bulk_deal_monitor.py): `src/signals/bulk_deal_monitor.py`
- [Technical analyzer](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/technical_analyzer.py): `src/signals/technical_analyzer.py`
- [Factor engine](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/factor_engine.py): `src/signals/factor_engine.py`
- [Tender monitor](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/tender_monitor.py): `src/signals/tender_monitor.py`
- [Pledge monitor](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/pledge_monitor.py): `src/signals/pledge_monitor.py`
- [Policy monitor](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/policy_monitor.py): `src/signals/policy_monitor.py`
- [Macro event monitor](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/macro_event_monitor.py): `src/signals/macro_event_monitor.py`
- [Lead-lag analysis](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/lead_lag.py): `src/signals/lead_lag.py`
- [Volume tracker](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/signals/volume_tracker.py): `src/signals/volume_tracker.py`

### Portfolio and alerts

- [Portfolio manager](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/execution/portfolio_manager.py): `src/execution/portfolio_manager.py`
- [Telegram notifier](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/execution/notifier.py): `src/execution/notifier.py`
- [Weekly tearsheet](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/execution/weekly_tearsheet.py): `src/execution/weekly_tearsheet.py`

### Research and validation

- [Event backtester](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/research/backtest.py): `src/research/backtest.py`
- [Factor backtest](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/research/factor_backtest.py): `src/research/factor_backtest.py`
- [Price store](https://github.com/kalwardin-dronzer/political_alpha_tracker/blob/main/src/data/price_store.py): `src/data/price_store.py`

### Other components

- **Operator**
- **Telegram**

## Connections

- Operator → Daily runner: runs (evidence: `main.py`)
- Daily runner → Pipeline orchestrator: starts (evidence: `main.py`)
- Operator → Refresh runner: refreshes (evidence: `README.md`)
- Refresh runner → Watchlist funnel: regenerates (evidence: `refresh.py`)
- Refresh runner → MCA director resolver: refreshes directors (evidence: `refresh.py`)
- Refresh runner → Entity resolution: resolves donors (evidence: `refresh.py`)
- Refresh runner → Donor ingestion: ingests (evidence: `refresh.py`)
- Refresh runner → Telegram notifier: sends summary (evidence: `refresh.py`)
- Watchlist funnel → Financial screener: filters fundamentals (evidence: `src/data/watchlist_generator.py`)
- Watchlist funnel → SQLite cache: persists candidates (evidence: `src/data/watchlist_generator.py`)
- Donor ingestion → SQLite cache: stores records (evidence: `src/data/donor_ingester.py`)
- Entity resolution → SQLite cache: resolves records (evidence: `src/data/entity_resolver.py`)
- MCA director resolver → SQLite cache: stores directors (evidence: `src/data/mca_resolver.py`)
- CIN resolver → SQLite cache: resolves identifiers
- Pipeline orchestrator → SQLite cache: reads watchlist (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → Political graph: queries connections (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → BSE monitor: scans announcements (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → Alpha engine: processes events (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → Insider tracker: checks insider activity
- Pipeline orchestrator → Bulk deal monitor: checks bulk deals (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → Tender monitor: monitors tenders (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → Pledge monitor: checks pledges (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → Policy monitor: checks policy events (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → Macro event monitor: checks macro events (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → Volume tracker: scans volume (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Alpha engine → Political graph: scores connections (evidence: `src/signals/alpha_engine.py`)
- Political graph → SQLite cache: loads company and donor data (evidence: `src/signals/graph_manager.py`)
- Alpha engine → Insider tracker: checks accumulation (evidence: `src/signals/alpha_engine.py`)
- Alpha engine → Bulk deal monitor: checks deals (evidence: `src/signals/alpha_engine.py`)
- Alpha engine → Technical analyzer: uses entry analysis (evidence: `src/signals/alpha_engine.py`)
- Pipeline orchestrator → Portfolio manager: manages positions (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Pipeline orchestrator → Telegram notifier: sends alerts (evidence: `src/pipeline/pipeline_orchestrator.py`)
- Portfolio manager → Technical analyzer: uses indicators (evidence: `src/execution/portfolio_manager.py`)
- Portfolio manager → SQLite cache: stores positions (evidence: `src/execution/portfolio_manager.py`)
- Telegram notifier → Telegram: sends messages (evidence: `README.md`)
- Daily runner → Weekly tearsheet: runs report (evidence: `main.py`)
- Weekly tearsheet → Telegram notifier: sends report (evidence: `src/execution/weekly_tearsheet.py`)
- Event backtester → Political graph: tests political signals (evidence: `src/research/backtest.py`)
- Factor backtest → Factor engine: evaluates factors (evidence: `src/research/factor_backtest.py`)
- Factor backtest → Price store: uses price history
- Event backtester → SQLite cache: uses stored data (evidence: `src/research/backtest.py`)
- Daily runner → Configuration: loads settings (evidence: `main.py`)
- Refresh runner → Configuration: loads settings (evidence: `refresh.py`)
