Methodology: Pipeline Architecture and Signal Lifecycle

Design philosophy

Market Synthesis operates on a single thesis: when market narrative and structural reality diverge, the eventual convergence creates a tradeable repricing event. I detect these gaps using adversarial LLM debate, validate them against market data, and express them as directional trades.

The design principles are:

  1. Adversarial over consensus. A single model can sound convincing while missing the best counter-argument. Structured debate forces internal disagreement before any conclusion.
  2. Market-data gates over hard-coded rules. Every filter uses observable market signals. No arbitrary thresholds or time limits.
  3. Precision over recall. Bad trades cost real money; missed trades only cost opportunity.
  4. Debate decides exits. No mechanical P&L gates or time limits. The same adversarial structure that opens a trade also decides when to close it.

Data sources

The pipeline ingests 632,000+ headlines across 6,155 indexed days (2014-2026) from five sources:

Source Coverage Role
The Guardian 4,505 days, 407K articles (headlines + bodies) Primary narrative signal
New York Times 4,515 days US-focused narrative
GDELT Global event database Event volume and tone
FOMC Minutes All meetings 2014-2026 Central bank policy language
SEC EDGAR 10-K/10-Q filings Corporate fundamental data

Supporting market data:

Source Data
FRED Macro indicators (rates, spreads, unemployment)
yfinance Historical prices for all tradeable instruments

All data is cached locally and synced to S3 (s3://market-synthesis-cache-ap). The pipeline runs entirely from cache — no live API calls during backtest.


Pipeline architecture

graph TD FEEDS["News Feeds
(Guardian + NYT + GDELT + FOMC + EDGAR)"] FEEDS --> DISC["Feed-Driven Discovery
Narrative collapse detection
Clusters related headlines"] DISC --> CLASS["Classifier (Sonnet 4.5)
Routes to 1 of 7 categories"] CLASS --> GATES["Entry Gates
Market-data-driven filters
TMV, ZB=F, SPY, FX momentum"] GATES -->|"passes"| DEBATE["Adversarial Debate
(8 agents per signal)"] GATES -->|"filtered"| SKIP["Signal skipped
(move already priced in)"] subgraph AGENTS["Debate Round"] direction LR PROS["Prosecutor
(Haiku 4.5)"] DEF["Defender
(Haiku 4.5)"] EXP["Domain Expert
(Sonnet 4.5)"] end DEBATE --> AGENTS PROS --> ADJ["Adjudicator (Sonnet 4.5)
Synthesizes verdict"] DEF --> ADJ EXP --> ADJ ADJ --> CAL["Calibration (Haiku 4.5)
ECE-optimized confidence"] ADJ --> INST["Instrument Selector
LLM + coherence gate"] CAL --> SIGNAL["Signal Store
(append-only JSONL)"] INST --> SIGNAL SIGNAL --> EXIT["Exit System
Periodic re-debate
Same adversarial structure"] EXIT -->|"gap still open"| HOLD["Hold position"] EXIT -->|"gap closed"| CLOSE["Close trade"] EXIT -->|"vol stop hit"| STOP["Stop-loss exit"] style FEEDS fill:#1d4ed8,stroke:#153ca8,color:#ffffff style DISC fill:#dbeafe,stroke:#3b82f6,color:#1e3a5f style CLASS fill:#f0f9ff,stroke:#0284c7,color:#0c4a6e style GATES fill:#fef3c7,stroke:#d97706,color:#78350f style DEBATE fill:#eef4ff,stroke:#4f7ee8,color:#0f2b57 style AGENTS fill:#f8fafc,stroke:#94a3b8 style PROS fill:#dcfce7,stroke:#16a34a,color:#14532d style DEF fill:#fee2e2,stroke:#dc2626,color:#7f1d1d style EXP fill:#fef3c7,stroke:#d97706,color:#78350f style ADJ fill:#e0e7ff,stroke:#4f46e5,color:#312e81 style CAL fill:#f0f9ff,stroke:#0284c7,color:#0c4a6e style INST fill:#f0f9ff,stroke:#0284c7,color:#0c4a6e style SIGNAL fill:#1d4ed8,stroke:#153ca8,color:#ffffff style EXIT fill:#e0e7ff,stroke:#4f46e5,color:#312e81 style HOLD fill:#dcfce7,stroke:#16a34a,color:#14532d style CLOSE fill:#fef3c7,stroke:#d97706,color:#78350f style STOP fill:#fee2e2,stroke:#dc2626,color:#7f1d1d style SKIP fill:#f1f5f9,stroke:#94a3b8,color:#475569

End-to-end pipeline: feed ingestion through adversarial debate to trade execution and exit


Signal lifecycle

Each signal passes through a defined lifecycle:

  1. Discovery. The feed processor identifies a cluster of headlines that suggest a narrative-reality divergence. Narrative collapse logic prevents re-emission of ongoing stories.

  2. Classification. A Sonnet 4.5 classifier routes the signal to one of seven domain categories. This is a high-stakes decision — miscategorization cascades through the entire pipeline.

  3. Entry gate check. Market-data-driven gates verify that the move is not already priced in. Each gate uses observable signals (bond momentum, FX levels, equity drawdowns).

  4. Adversarial debate. Three domain-specialized agents (Prosecutor, Defender, Expert) argue the signal in parallel. The Adjudicator synthesizes their arguments into a directional verdict with confidence score.

  5. Calibration. A calibration agent adjusts the raw confidence using ECE optimization — correcting for known overconfidence patterns.

  6. Instrument selection. An LLM-based selector picks the tradeable expression (futures, ETFs, FX pairs). A coherence gate verifies the instrument matches the signal direction.

  7. Position entry. The signal enters the signal store with full provenance (debate transcripts, gate checks, instrument rationale).

  8. Periodic exit review. The same adversarial debate structure reviews open positions weekly. The debate determines whether the narrative-reality gap is still open.

  9. Exit. Three outcomes: debate decides gap closed (planned exit), volatility stop-loss triggered (mechanical override), or gap widens further (hold continues).


Adversarial debate protocol

The debate is the core intellectual contribution. Each signal receives a full adversarial hearing:

Agent roles

Agent Model Role
Prosecutor Haiku 4.5 Argues FOR the narrative-reality gap being tradeable
Defender Haiku 4.5 Argues AGAINST — finds reasons the gap will not close
Domain Expert Sonnet 4.5 Provides specialist analysis for the category
Adjudicator Sonnet 4.5 Weighs all arguments, produces verdict
Calibration Haiku 4.5 Adjusts confidence for ECE optimization

Why mixed models work

Haiku advocates commit firmly to their position. This gives the Sonnet adjudicator clean, differentiated signal to work with. Homogeneous Sonnet debates produce more equivocal arguments that are harder to adjudicate.

Domain specialization

All three debate agents (Prosecutor, Defender, Expert) use category-specific prompt templates. Seven categories times three agents yields 21 specialized prompts, each tuned over 38 iterations to the failure modes of that category.

For example:


Entry gates

The v38 gates are market-data-driven filters. The design principle: if observable market data already reflects the thesis, the trade is late.

Gate Market Signal Threshold Category
CB regime TMV 90d momentum [0%, 20%] Central bank
CB rates momentum ZB=F 30d return < -6% = skip Central bank
Geo drawdown SPY 60d return < -7% = skip Geopolitical
FX momentum FX pair 30d move > 27% = skip Currency peg
SD own-currency Instrument check GBPUSD/AUDUSD/USDCAD = skip Sovereign debt
RE catalyst Debate evidence Must cite acute forcing event Real estate
Instrument coherence Direction match Instrument must align with signal All
Vol stop-loss 3-sigma of 5d returns Mechanical exit All

Each gate was added only after identifying a systematic loss pattern and validating that the gate eliminates losses without filtering winners. The thresholds are derived from empirical backtest analysis, not theoretical priors.


Instrument selection

The instrument selector uses a 3-layer approach:

  1. Disk cache — previously validated instrument mappings
  2. Static registry — known mappings for common signals (e.g., oil supply disruption maps to CL=F)
  3. LLM fallback — Sonnet selects the instrument with reasoning, subject to coherence gate

The coherence gate verifies that the selected instrument actually moves in the direction the signal predicts. A short signal paired with a long-only ETF is caught and corrected before entry.


Reproducibility

The entire pipeline is deterministic (temperature 0.0 across all LLM calls). Same input produces same output. All intermediate artifacts are preserved:

To reproduce:

cd development
python -u run.py --mode feed --from 2014-01-01 --to 2026-06-01 --workers 10
python -u tests/validate_lifecycle.py
python -u tests/evaluate_store.py
python tests/test_pipeline_invariants.py  # 27/27 tests pass

Cost model

The pipeline costs approximately $0.04 per emitted signal (8 API calls: 5 Haiku + 3 Sonnet via AWS Bedrock). A full 12-year backtest with 140 trades costs under $6 in API fees.


For the exit system in detail, see Exit System. For backtest results, see Findings.