Module 2 — Economic Event & Market-Reaction Engine

Normative specification. Module 2 is deterministic (no LLM). It classifies a scheduled economic release and the market's reaction to it, and decides whether the information is stable enough for the trading bot to review. It does not decide bullish/bearish, pick sectors/stocks, or place orders — those belong to the specialist macro modules, Output 2, and the trading bot.

Implementation: routes/module2.pysnapshots/module2.json, surfaced in the "Module 2" navbar view.


1. Three separate outcomes

Module 2 must not produce one vague event result. It produces three separate decisions, which remain separate:

Example: CPI materially hotter than expectedConfirmed risk-off reactionReady for trading-bot review.


2. Calculation of each release component

For every numeric component:

Std surprise Class
≥ +2.00 EXTREME ABOVE-EXPECTATION
+1.00 … <+2.00 MATERIAL ABOVE-EXPECTATION
+0.50 … <+1.00 SMALL ABOVE-EXPECTATION
−0.50 … <+0.50 IN LINE
−1.00 … ≤−0.50 SMALL BELOW-EXPECTATION
−2.00 … ≤−1.00 MATERIAL BELOW-EXPECTATION
≤ −2.00 EXTREME BELOW-EXPECTATION

3. Previous-value revisions


4. Direction multiplier

Assign an exact multiplier to every component: +1 if a higher figure increases the named event condition, −1 if it decreases it. ORIENTED_COMPONENT_SCORE = CAPPED_STD_SURPRISE × DIRECTION_MULTIPLIER.

Examples: higher CPI → hotter inflation (+1); higher payrolls → stronger employment (+1); higher unemployment → weaker employment (−1); higher layoffs → weaker (−1). This is an economic-condition score, not a stock-direction call.


5. Event-level weighted score


6. Event-data score bands

Score Band
≥ +2.00 EXTREME POSITIVE
+1.00 … <+2.00 MATERIAL POSITIVE
+0.50 … <+1.00 SMALL POSITIVE
−0.50 … <+0.50 IN LINE
−1.00 … ≤−0.50 SMALL NEGATIVE
−2.00 … ≤−1.00 MATERIAL NEGATIVE
≤ −2.00 EXTREME NEGATIVE

"Positive/negative" are replaced by event-specific words (inflation: hotter/cooler; employment/growth/demand: stronger/weaker; central bank: tighter/easier than priced).


7. Conflicting components


8–20. Per-event calculations

Implementation note (v1, headline-first): the engine currently scores the primary component at 100% for every event type (§20 fallback). The full component weight tables below are the target once FMP calendar-row matching per release is proven. Weights and critical-component sets are recorded here as the authoritative reference.

8. CPI — inflation heat

Critical: Core CPI MoM, Headline CPI MoM. Weights: Core MoM 40%, Headline MoM 25%, Core YoY 15%, Headline YoY 10%, prev Core MoM revision 5%, prev Headline MoM revision 5%. Direction: all +1. Labels: EXTREMELY / MATERIALLY / SLIGHTLY HOTTER · BROADLY IN LINE · SLIGHTLY / MATERIALLY / EXTREMELY COOLER · CPI COMPONENTS MIXED.

9. PCE — inflation heat

Critical: Core PCE MoM, Headline PCE MoM. Weights: Core MoM 45%, Headline MoM 20%, Core YoY 15%, Headline YoY 10%, prev Core MoM revision 5%, prev Headline MoM revision 5%. Direction: all +1. Same bands as CPI. Pass-through to Consumer Strength module (not mixed into inflation score): personal income, personal spending, real personal spending, savings rate.

10. PPI — producer-price pressure

Critical: Headline PPI MoM, Core PPI MoM. Weights: Core MoM 35%, Headline MoM 30%, ex-food/energy/trade 20%, Core YoY 5%, Headline YoY 5%, prev Core revision 3%, prev Headline revision 2%. Direction: all +1. Labels: EXTREMELY/MATERIALLY/SLIGHTLY HOTTER · IN LINE · SLIGHTLY/MATERIALLY/ EXTREMELY COOLER · COMPONENTS MIXED.

11. Employment report — labour strength & tightness

Critical: Nonfarm Payrolls, Unemployment rate, Avg hourly earnings MoM. Weights: NFP 35%, Unemployment 20%, AHE MoM 20%, two-month net payroll revision 15%, private payrolls 5%, avg weekly hours 5%. Direction: NFP +1, Unemployment −1, AHE +1, revision +1, private payrolls +1, weekly hours +1. Labels: EXTREMELY/MATERIALLY/SLIGHTLY STRONGER · BROADLY IN LINE · SLIGHTLY/ MATERIALLY/EXTREMELY WEAKER · EMPLOYMENT COMPONENTS MIXED.

12. JOLTS — labour demand

Critical: Job openings. Weights: openings 70%, prev openings revision 10%, quits rate 10%, hiring rate 5%, layoffs & discharges 5%. Direction: openings +1, revision +1, quits +1, hiring +1, layoffs −1. Labels: EXTREMELY/MATERIALLY/SLIGHTLY STRONG · IN LINE · SLIGHTLY/MATERIALLY/ EXTREMELY WEAK LABOUR DEMAND · COMPONENTS MIXED.

13. GDP — two separate outcomes

14. ISM (Manufacturing & Services)

15. Retail sales — consumer demand strength

Critical: control group, headline. Weights: control group 40%, headline 25%, ex-autos 20%, ex-autos-and-fuel 10%, prev control-group revision 5%. Direction: +1. Labels: EXTREMELY/MATERIALLY/SLIGHTLY STRONGER · IN LINE · SLIGHTLY/MATERIALLY/ EXTREMELY WEAKER CONSUMER DEMAND · COMPONENTS MIXED.

16. Federal Reserve rate decision (mechanical surprise only)

17. Foreign central-bank rate decision

Same calculations as §16 (expected/actual midpoint, bps surprise, probability class). Statement/guidance/asset-purchases/press-conference → Central Banks module.

18. FOMC minutes, speeches, testimony (no numeric consensus)

Output EVENT_DATA_OUTCOME = TEXT EVENT — NUMERIC OUTCOME NOT AVAILABLE, OFFICIAL_TEXT_STATUS, TRANSCRIPT_STATUS, TEXT_DIFFERENCES_FROM_PREVIOUS, MARKET_REACTION_OUTCOME, SPECIALIST_INTERPRETATION_REQUIRED = TRUE. Never invent a numeric score.

19. Major Treasury announcements

Per numeric component: actual, dealer/market consensus, raw surprise, std surprise, above/in-line/below. Components: borrowing estimate, refunding amount, auction size by maturity, change in auction size, buybacks, issuance-schedule changes. Do not combine into one directional score. Output TREASURY COMPONENTS CONSISTENT / MIXED / REPORT INCOMPLETE. Funding-pressure verdict → Treasury Auctions module.

20. Other numeric events

Primary headline component at weight 100%; compute raw + std surprise; classify above/in-line/below. Do not invent secondary weights; pass secondary components separately.


21. Market-reaction calculation (independent of event data)


22. Normalised market reaction


23. Combined market-reaction score

Positive = risk-on, negative = risk-off. Weights: S&P 35%, QQQ/Nasdaq 20%, IWM/Russell 15%, VIX 20%, breadth 10%. Equity up = +, breadth improving = +, VIX up = − (ORIENTED_VIX = NORMALISED_VIX × −1). MARKET_REACTION_SCORE = weighted average of valid oriented reactions. S&P and VIX are critical; ≥70% of weight must be available (renormalise to 100%); missing critical data → REACTION DATA INVALID.


24. Market-reaction score bands

Score Band
≥ +2.00 EXTREME RISK-ON
+1.00 … <+2.00 MATERIAL RISK-ON
+0.50 … <+1.00 SMALL RISK-ON
−0.50 … <+0.50 NO MATERIAL DIRECTION
−1.00 … ≤−0.50 SMALL RISK-OFF
−2.00 … ≤−1.00 MATERIAL RISK-OFF
≤ −2.00 EXTREME RISK-OFF

Compute a separate reaction score at every required horizon.


25. Market-reaction conflicts


26. Reaction confidence score

Start at 0. Add +1 each: SPY/QQQ/IWM not materially disagreeing; VIX confirms equities; breadth confirms equities; 15/30/60-min directions agree; close confirms 60-min; next-day 09:45 confirms event-day. Subtract: −2 two-sided; −2 unusually volatile; −1 equity-index conflict; −1 equity/VIX conflict; −1 30-min reverses 5-min. Classification: ≥4 HIGH · 2–3 MEDIUM · 0–1 LOW · <0 CONFLICTING.


27. Final market-reaction outcome (first match wins)

Critical data invalid → REACTION DATA INVALID · not released → REACTION NOT STARTED · 5-min incomplete → COLLECTING REACTION DATA · two-sided → CONFLICTING TWO-SIDED · unusually volatile → CONFLICTING HIGH-VOLATILITY · confidence <0 → CONFLICTING REACTION · next-day confirm → NEXT-DAY CONFIRMED RISK-ON/OFF · close confirm → CLOSING-CONFIRMED RISK-ON/OFF · 15/30/60 agree → INTRADAY-CONFIRMED RISK-ON/OFF · only 30-min → PROVISIONAL RISK-ON/OFF/NEUTRAL · only 5-min → INITIAL REACTION ONLY.


28. Module 2 event outcome (two joined but separate labels)

MODULE_2_EVENT_OUTCOME_LABEL = EVENT_DATA_OUTCOME — MARKET_REACTION_OUTCOME (e.g. CPI MATERIALLY HOTTER THAN EXPECTED — CLOSING-CONFIRMED RISK-OFF). Never reduce the two to a single bullish/bearish number; the specialist module interprets macro meaning.


29. Event-trade review decision (first match wins)

Analysis disabled → EVENT TRADE MODE DISABLED · cancelled → NOT APPLICABLE · not occurred → EVENT TRADE BLOCKED · waiting period active → COLLECTING REACTION DATA · event data invalid → SKIP — INVALID EVENT DATA · reaction data invalid → SKIP — INVALID REACTION DATA · two-sided → SKIP — TWO-SIDED REACTION · unusually volatile → SKIP — UNUSUALLY VOLATILE · confidence <0 → SKIP — CONFLICTING REACTION · confidence 0–1 with a stage remaining → CONTINUE COLLECTING · confidence 0–1 after final stage → SKIP — NO CLEAR REACTION · confidence ≥2 with no pause → READY FOR TRADING-BOT REVIEW.

"Ready for trading-bot review" ≠ trade approved; it only means the info is complete enough to examine.


30. Required outputs

For every event, Output 1 contains the full trail: Event-data: actual, consensus median, previous, revised previous, raw surprise, relative surprise, surprise scale, uncapped & capped std surprise, direction multiplier, oriented component score, component weight, weighted contribution, available total weight, event-data score, component-conflict status, event-data outcome. Market-reaction: pre-event reference per instrument; price/yield/VIX move per horizon; historical median abs move; normalised & oriented reaction; instrument weight; weighted contribution; reaction score per horizon; equity-index conflict; equity/VIX conflict; two-sided; unusually volatile; confidence points & classification; final reaction outcome. Permission/handoff: normal swing-trade permission; pause start/end; earliest event-trade review time; event-trade review status; module-2 event-outcome label; specialist module receiving the event; specialist interpretation status; Output-2 handoff status; trading-bot handoff status; trade_approved = FALSE; order_generated = FALSE.


31. What Module 2 does NOT calculate

Whether hotter CPI / stronger employment is bullish or bearish under the current regime; whether a Fed statement is dovish/hawkish; sector or stock preference; position size or count; entry, stop, target; trade execution. Those belong to the specialist macro modules, Output 2, and the trading bot.