Files
encyclopedia-knowledge-graph/docs/archive/PLAN-MACROECONOMIC-INDICATORS-INTEGRATION-CPI-PPI-RATES-M2-GDP.md
T

98 lines
14 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Plan: Integrating Real Macroeconomic & Monetary Indicators (`CPI`, `PPI`, `US10Y`, `EFFR/SOFR` Overnight Lending Rates, `M2`, `M1 vs. M2 Spread`, `Real M2 Growth`, `GDP` & `Gross Product / Aggregate Output`) (`v2.0.24`)
- **Document ID:** `PLAN-MACROECONOMIC-INDICATORS-INTEGRATION-CPI-PPI-RATES-M2-GDP` (`v2.0.24`)
- **Roadmap Status:** **ACTIVE / READY**
- **Keyless Primary Data Source (`100%` Real Federal Reserve Data, `0` API Keys, `0` Synthetic Values):**
All macroeconomic series are ingested directly from the official **St. Louis Federal Reserve (`FRED`) keyless CSV endpoint** (`https://fred.stlouisfed.org/graph/fredgraph.csv?id=<SERIES_ID>`) paired with Yahoo Finance (`^TNX`) and cached in `/workspace/hyperstitionstudio-core/site/quant/real-macro-indicators.json` for offline `file://` portability.
- **Strict Cadence Honesty & Null-Preserving Policy:**
- **Zero Interpolation / Zero Forward-Filling:** Monthly (`1mo`: `CPI`, `PPI`, `M1`, `M2`, `Real M2`, `INDPRO`) and quarterly (`1q`: `GDP`, `GDPC1`, `GNP`, `OUTBS`) series are **never** linearly interpolated or duplicated into fake daily bars.
- **Language-Appropriate `null` When Unavailable:** On any date where a daily series (`DGS10`, `EFFR`, `SOFR`) has no published observation (e.g., weekends or US federal holidays such as `2026-11-26` Thanksgiving where FRED reports `.` / empty), all numeric and `AQ` fields store `None` (Python) / `null` (JSON/JS) / `NULL` (SQLite) and display `"No data available"` in the UI—never `0.0`.
- **Target Modules & Files:**
- `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/quant/macro.py` (`hs-macro-harvest` CLI & Python collector/analyzer)
- `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/quant/{collector,timeseries,daily_brief}.py`
- `/workspace/hyperstitionstudio-core/site/quant/{index.html,quant-app.js,real-macro-indicators.json}`
- `/workspace/hyperstitionstudio-core/tests/test_core_suite.py`
---
## 1. Master Specification of the 12 Integrated Macroeconomic & Aggregate Output Series
Every series below has been live-tested against `https://fred.stlouisfed.org/graph/fredgraph.csv?id=<SERIES_ID>` and verified to return real observations without authentication:
| # | Indicator Slug & UI Label | Official FRED Series ID(s) | Native Cadence | Latest Verified Real Observation in FRED | Derived Metrics Computed (`MoM / QoQ / YoY` & Spreads) | Taxonomic Guild & Regime Role (`S1–S6` / `M1–M3`) |
| :- | :--- | :--- | :---: | :--- | :--- | :--- |
| **1** | **`CPI` — Consumer Price Index (All Urban Consumers)** | `CPIAUCSL` | Monthly (`1mo`) | `2026-10-01`: **`337.476`**<br/>*(prior `336.298`)* | • `MoM_bps` (`+35 bps` / `+0.35%`)<br/>• `YoY_pct` & `YoY_bps` | Purchasing-power denominator; gates `M1` stagflation vs. `M2` inflationary fever. |
| **2** | **`PPI` — Producer Price Index (All Commodities)** | `PPIACO` | Monthly (`1mo`) | `2026-10-01`: **`293.921`**<br/>*(prior `294.473`)* | • `MoM_bps` (`-19 bps` / `-0.19%`)<br/>• `YoY_pct` & `YoY_bps`<br/>• **`PPI - CPI` Pipeline Margin Spread** | Upstream industrial/supply-chain cost pressure feeding `S3` fabs, defense, and energy. |
| **3** | **`US10Y` — 10-Year US Treasury Yield** | `DGS10` *(+ Yahoo `^TNX`)* | Daily (`1d`) | `2026-11-25`: **`4.85%` (`485 bps`)**<br/>`2026-11-27`: **`4.94%` (`494 bps`)** | • Yield in `bps` (`485` / `494`)<br/>• Daily `change_bps`<br/>• Real 10Y Yield (`US10Y - CPI YoY%`) | Risk-free discount rate governing `S6` sovereign debt capture and `S1` long-duration AI multiples. |
| **4** | **Overnight Lending Rates (`EFFR` & `SOFR`)** | `EFFR` *(Fed Funds)* & `SOFR` *(Secured Overnight)* + `DFEDTARU` | Daily (`1d`) | `2026-11-27`:<br/>• `EFFR`: **`3.88%` (`388 bps`)**<br/>• `SOFR`: **`3.98%` (`398 bps`)**<br/>• `DFEDTARU`: **`4.00%`** | • Rate in `bps` (`EFFR = 388`, `SOFR = 398`)<br/>• **`SOFR - EFFR` Repo Plumbing Spread (`+10 bps`)**<br/>• **`US10Y - EFFR` Term Curve Slope (`+106 bps`)** | Short-end funding cost & overnight repo collateral stress (`S2` liquidity & `S6` banking plumbing). |
| **5** | **`M1` — Narrow Liquid Money Stock** | `M1SL` | Monthly (`1mo`) | `2026-10-01`: **`$20,166.9B`** (`$20.17T`) | • Level (`$B` / `$T`)<br/>• `MoM_bps` (`+52 bps`) & `YoY_bps` | Immediate demand-deposit & checking liquidity available for transaction velocity. |
| **6** | **`M2` — Broad Money Supply** | `M2SL` | Monthly (`1mo`) | `2026-10-01`: **`$23,532.8B`** (`$23.53T`) | • Level (`$B` / `$T`)<br/>• `MoM_bps` (`+51 bps`) & `YoY_bps` | Aggregate monetary liquidity reservoir driving `M3` Leviathan asset-price inflation. |
| **7** | **`M1 vs. M2 Spread` (Time-Deposit & Velocity Spread)** | Derived from `M1SL` & `M2SL` | Monthly (`1mo`) | `2026-10-01`:<br/>• `M2 - M1`: **`$3,365.9B` (`$3.37T`)**<br/>• `M1 / M2 Ratio`: **`85.70%`** | • **Level Spread (`M2SL - M1SL` in `$B`)**: Non-M1 parked retail time deposits & money-market funds<br/>• **Growth Spread (`M1 YoY bps - M2 YoY bps`)** | Measures whether liquidity is mobilizing into active transaction balances (`M1` rising faster than `M2` -> Risk-On) or retreating into parked yield-bearing deposits (`M2 - M1` widening -> `M1` Stagnation). |
| **8** | **`Real M2` & `Real M2 Growth` (CPI-Deflated Money Supply)** | `M2REAL` | Monthly (`1mo`) | `2026-10-01`: **`$6,973.2B`**<br/>*(prior `$6,962.4B`)* | • `Real_M2_MoM_bps` (`+16 bps` / `+0.16%`)<br/>• **`Real_M2_YoY_pct` & `Real_M2_YoY_bps`** | True inflation-adjusted monetary expansion/contraction; leading liquidity indicator for `S1/S2` risk assets. |
| **9** | **Nominal & Real `GDP` (Gross Domestic Product)** | `GDP` *(Nominal `$B SAAR`)* & `GDPC1` *(Real Chained-2017 `$B`)* | Quarterly (`1q`) | `2026-Q3` (`2026-07-01`):<br/>• `GDP`: **`$33,056.20B` (`$33.06T`)**<br/>• `GDPC1`: **`$24,665.20B` (`$24.67T`)** | • `QoQ_annualized_pct` & `YoY_pct`<br/>• **`GDP / M2` Monetary Velocity (`1.405x`)**<br/>• **Implicit GDP Deflator (`GDP / GDPC1`)** | Sovereign domestic output denominator (`S6` Apparatus of Capture & macro growth regime). |
| **10** | **Gross Product & Aggregate Output (`GNP`, `OUTBS`, `INDPRO`)** | • `GNP` *(Gross National Product `$B`)*<br/>• `OUTBS` *(Business Sector Real Output Index)*<br/>• `INDPRO` *(Monthly Industrial Production Index)* | Quarterly (`1q`) & Monthly (`1mo`) | • `GNP` (`2026-Q3`): **`$33,026.51B`**<br/>• `OUTBS` (`2026-Q3`): **`128.965`**<br/>• `INDPRO` (`2026-10-01`): **`102.2421`** | • `GNP_QoQ_bps`, `OUTBS_QoQ_bps`, `INDPRO_MoM_bps` (`-43 bps`)<br/>• **`GNP - GDP` Net Foreign Factor Income Spread (`-$29.69B`)** | Real physical & business-sector aggregate output benchmark against which financial market capitalization is measured. |
---
## 2. Bidirectional (`eng_aq` Gen 0 & `ing_aq` Gen 1) Evaluation of Macroeconomic Readouts
Just like the 24 market tickers, every macroeconomic observation is evaluated across both **Standard Written English (`Gen 0` `eng_aq`)** and **Phonemic Ingglish (`Gen 1` `ing_aq`)**—revealing remarkable structural locks in the real Federal Reserve data:
| Indicator & Real Observation | Numerical Representation | `Gen 0` Written (`eng_aq`) | `Gen 1` Phonemic (`ing_aq`) | Structural / Taxonomic Lock Discovered in Real FRED Data |
| :--- | :--- | :--- | :--- | :--- |
| **`EFFR` (`2026-11-27` = `3.88%`)** | Rate in basis points = **`388 bps`** | Face integer **`388`** | `"three huhndrad aytee ayt"` = `348` | **`388` == Exact Total Node Count of the Encyclopedia Knowledge Graph (`388` Nodes)**! |
| **`OUTBS` (`2026-Q3` = `128.965`)** | Rounded integer index = **`129`** (`floor = 128`) | Face integers **`129` / `128`** | `"wuhn huhndrad twentee nain"` | **`129 == blakwel == ruhsha == awflain [S3 / M7+]`**; **`128 == nik land == masheen == serkat [S3]`**! |
| **`CPI` (`2026-10-01` = `337.476`)** | Rounded integer = **`337`**; `MoM = +35 bps` | **`337` (`68th PRIME`)** | `"therdee faiv"` (`35 bps`) = **`166`** | `MoM +35 bps` spoken in `Gen 1` (`"therdee faiv"`) = **`166 == order buk == noo flesh [S2]`**! |
| **`PPI` (`2026-10-01` = `293.921`)** | `MoM = -19 bps`; Prior = `294` | `"nineteen"` = **`137 [33rd PRIME]`** | `"nainteen"` = **`137 [33rd PRIME]`** ($\Delta = 0$ Isometric!) | **`19` spoken (`"nineteen" -> "nainteen"`) is a `G4` Isometric Chokepoint (`137 == envideea == hawlts == inersha [S3 / M1]`)**! |
| **`M2 - M1 Spread` (`$3,365.9B`)** | Scaled string `"$3.37T"` (`337`) | `"three point three seven trillion"` | `"three point three sevan trilyan"` | Matches the `337 [68th PRIME]` CPI coordinate and scales alongside Nvidia's `$3.35T–$3.37T` mega-cap tier (`M3` Leviathan). |
---
## 3. Macro-to-Equity & Macro-to-Memetic Regime Coupling Rules
Integrating these 12 macroeconomic series unlocks four objective macro-regime signals that feed directly into `/quant/` and the **Daily Portfolio & Memetic Regime Update (`PLAN-DAILY-PORTFOLIO-AND-MEMETIC-REGIME-UPDATE-FEATURE`)**:
1. **Overnight Plumbing & Yield-Curve Stress Gate (`SOFR - EFFR` & `US10Y - EFFR`):**
- **Repo Plumbing Spread (`SOFR - EFFR`):** On `2026-11-27`, `SOFR (3.98%) - EFFR (3.88%) = +10 bps`. When `SOFR - EFFR >= +15 bps`, overnight collateral is scarce, signaling an `S2` liquidity squeeze (`M2` flash-crash precursor).
- **Term Structure Slope (`DGS10 - EFFR`):** On `2026-11-25/27`, `4.85% - 3.88% = +97 bps` (`+97 bps -> "naintee sevan" [Gen 1] = 237 == kansorsheeam [S6]`).
2. **Monetary Velocity & Liquidity Impulse Gate (`Real M2 Growth` & `M1 vs. M2 Spread`):**
- When `Real M2 YoY % > 0` and `M1 MoM bps >= M2 MoM bps` (`+52 bps >= +51 bps` in `2026-10`), real liquidity is expanding into active transaction balances, supporting `S1` AI and `S2` crypto multiples.
- When `Real M2 YoY % < 0` and `M2 - M1 Spread` widens while `INDPRO` contracts (`-43 bps` in `2026-10`), money is parked in defensive time deposits while industrial output slows—activating **`M1_ENTROPIC_STAGNATION`**.
3. **Upstream-Downstream Inflation Margin Gate (`PPI MoM bps - CPI MoM bps`):**
- In `2026-10`, `PPI MoM (-19 bps) - CPI MoM (+35 bps) = -54 bps`, indicating easing upstream commodity input costs relative to consumer prices (margin expansion for `S1/S6` corporate operators).
4. **Aggregate Output & Leviathan Capitalization Ratio (`GDP`, `GNP`, `OUTBS`, `INDPRO`):**
- Compares the combined market capitalization of the top `M3` Leviathan tickers against US `GDP` (`$33.06T`) and `GNP` (`$33.03T`) and tracks `GDP / M2` velocity (`1.405x`).
---
## 4. Four-Phase Implementation Roadmap (`Phases 1–4`)
### Phase 1: Build `src/hyperstitionstud_io/quant/macro.py` & `hs-macro-harvest` CLI
1. Create `/workspace/hyperstitionstudio-core/src/hyperstitionstud_io/quant/macro.py` implementing:
- `fetch_fred_series_csv(series_id, timeout=8.0)`: Keyless HTTP fetcher for `https://fred.stlouisfed.org/graph/fredgraph.csv?id=<series_id>` that strips missing `.` rows (converting missing dates to `None` / `null`, never `0.0`).
- `build_macro_indicators_bundle(allow_live_network=True, write_files=True)`:
- Ingests all 12 series (`CPIAUCSL`, `PPIACO`, `DGS10`, `EFFR`, `SOFR`, `DFEDTARU`, `M1SL`, `M2SL`, `M2REAL`, `GDP`, `GDPC1`, `GNP`, `OUTBS`, `INDPRO`),
- Computes `M1 vs. M2 Spread` (`M2SL - M1SL` in `$B`, `M1/M2` ratio `%`, and `M1_MoM_bps - M2_MoM_bps`), `Real M2 Growth` (`MoM_bps` & `YoY_pct`), `SOFR - EFFR` repo spread, `DGS10 - EFFR` curve slope, `PPI - CPI` margin spread, `GDP / M2` velocity, and `GNP - GDP` net foreign factor spread,
- Computes bidirectional `Gen 0` (`eng_aq`) and `Gen 1` (`ing_aq`) evaluations on every observation and change rate, and
- Persists `/workspace/hyperstitionstudio-core/site/quant/real-macro-indicators.json` with an IPLD `dag-json` `CIDv1` digest.
2. Register `hs-macro-harvest = "hyperstitionstud_io.quant.macro:main"` in `pyproject.toml`.
### Phase 2: Integrate Macro Indicators into `timeseries.py`, `daily_brief.py` & `/api/v1/quant/macro`
1. Attach the `macro_indicators_summary` block to `quant-timeseries.json` / `quant-timeseries-data.js` and expose `GET /api/v1/quant/macro` on `src/hyperstitionstud_io/mcp/rest.py` (and `hs_scan_financial_quant_harvest` in `mcp/tools.py`).
2. Feed the 12 real macroeconomic indicators directly into **Agendas 1–4** of `PLAN-DAILY-PORTFOLIO-AND-MEMETIC-REGIME-UPDATE-FEATURE` (`daily_brief.py`).
### Phase 3: Add the Macroeconomic & Aggregate Output Strip on `/quant/` (`site/quant/index.html` & `quant-app.js`)
1. Add a dedicated **Macroeconomic, Monetary & Aggregate Output Telemetry Panel** on `/quant/index.html` displaying:
- **Inflation & Pipeline:** `CPI` (`337.48`, `+35 bps MoM`) & `PPI` (`293.92`, `-19 bps MoM`, `nainteen = 137 [Iso]`),
- **Rates & Overnight Plumbing:** `US10Y` (`4.85% / 4.94%`), `EFFR` (`3.88% = 388 bps`), `SOFR` (`3.98% = 398 bps`), `SOFR - EFFR` (`+10 bps`), and `10Y - EFFR` (`+97 bps -> 237`),
- **Money Supply & Velocity:** `M2` (`$23.53T`), `M1` (`$20.17T`), `M1 vs. M2 Spread` (`$3.37T` / `85.7%`), and `Real M2` (`$6,973.2B`, `+16 bps MoM`),
- **Aggregate Output:** Nominal `GDP` (`$33.06T`), Real `GDPC1` (`$24.67T`), `GNP` (`$33.03T`), `OUTBS` Business Output (`128.97 -> 129 == blakwel`), and `INDPRO` Industrial Production (`102.24`),
- Plus inline `ⓘ` info icons (`QUANT_TERM_GLOSSARY`) explaining each macroeconomic indicator in `<= 1 paragraph` of plain English.
### Phase 4: Verification in `tests/test_core_suite.py` & `deploy/test-first-deployment.sh`
1. Add unit assertions in `tests/test_core_suite.py` verifying:
- All 12 macroeconomic series load from real FRED data with `synthetic_data_eliminated == True`,
- Missing holiday dates (such as `2026-11-26` on `EFFR`/`SOFR`/`DGS10`) return `None` / `null` (`"No data available"`) rather than `0.0`,
- Derived indicators (`M1 vs. M2 Spread`, `Real M2 Growth`, `SOFR - EFFR`, `GDP / M2` velocity) and their `eng_aq` / `ing_aq` evaluations match exact arithmetic, and
- `/quant/real-macro-indicators.json` returns `HTTP 200 OK` in `deploy/test-first-deployment.sh`.