How typesparky/prediction-market-intelligence works
This repository is a Polymarket signal-intelligence product whose documented workflow runs from trend detection and market discovery through filtering, polarity/volume analysis, analyst briefing, and sector analysis. Persistent signal, episode, and entity memories support cross-run queries and reflection; an API and dashboard expose pipeline status. The graph preserves these major branches. Several implementation files are unsampled, so their connections are shown only where documented in the README or supported by indexed source references.
Main entry points: trend_detector.py Trend Detection · query_router.py Memory Query Router · orchestrator.py Signal Orchestration · market_processor_production.py Market Filtering
Components 24
Data and Trends
- Trend Detection
packages/trend_detector/trend_detector.py - Momentum Ledger
packages/trend_detector/ledger.py - Market Discovery
packages/polymarket_fetcher/unified_fetcher.py
Signal Pipeline
- Signal Orchestration
src/pipeline/orchestrator.py - Market Filtering
src/analytics/market_processor_production.py - Market Cleaning
src/analytics/market_cleaner.py - Polarity Labeling
src/llm/openrouter_labeler.py - Signal Output
src/pipeline/signal.py
Analysis and Briefing
- Analyst Deliberation
analyst_report.py - Web Search Enrichment
analyst_report.py - CIO Briefing
analyst_report.py - Sector Analysis
src/pipeline/sector_trends_engine.py
Memory and Reflection
- Signal Memory
src/core/signal_memory.py - Episodic Memory
src/core/episodic_memory.py - Entity Hypergraph
src/core/entity_hypergraph.py - Memory Query Router
src/core/query_router.py - Weekly Reflection
src/core/weekly_reflection.py
Status and Dashboard
- Status API
scripts/api_server.py - Dashboard
scripts/dashboard/generate_dashboard.py
Other components
- CIO / User
- Polymarket APIs
- RSS Feeds
- Hyperliquid
- Brave Search
Connections 27
- Polymarket APIs → Trend Detection: provides market data
README.md - RSS Feeds → Trend Detection: provides feed data
README.md - Hyperliquid → Trend Detection: provides market data
README.md - Trend Detection → Momentum Ledger: scores and records
README.md - Trend Detection → Market Discovery: precedes discovery
README.md - Market Discovery → Polymarket APIs: fetches markets
- Signal Orchestration → Market Filtering: filters markets
src/pipeline/orchestrator.py - Market Filtering → Market Cleaning: cleans markets
src/analytics/market_processor_production.py - Market Filtering → Polarity Labeling: labels markets
src/analytics/market_processor_production.py - Signal Orchestration → Signal Output: produces signal
README.md - Signal Orchestration → Market Discovery: discovers markets
README.md - Trend Detection → Signal Orchestration: starts signal stages
README.md - Signal Output → Analyst Deliberation: informs briefing
README.md - Brave Search → Web Search Enrichment: returns search results
README.md - Analyst Deliberation → Web Search Enrichment: requests research
README.md - Web Search Enrichment → CIO Briefing: enriches synthesis
README.md - Analyst Deliberation → CIO Briefing: contributes assessments
README.md - Signal Output → Sector Analysis: cross-correlates signals
- RSS Feeds → Sector Analysis: supplies news
src/pipeline/sector_trends_engine.py - CIO / User → Memory Query Router: submits queries
README.md - Memory Query Router → Signal Memory: routes quantitative queries
src/core/query_router.py - Memory Query Router → Episodic Memory: routes history queries
src/core/query_router.py - Memory Query Router → Entity Hypergraph: routes discovery queries
src/core/query_router.py - Signal Memory → Momentum Ledger: loads scored markets
README.md - Weekly Reflection → Episodic Memory: reviews pipeline runs
- Status API → Dashboard: serves pipeline status
README.md - CIO / User → Status API: checks run status
README.md