koala73 / koala73/worldmonitor
feat(markets): market-depth analytics — US yield-curve MCP exposure with inversion flags, BTC technicals, bond ETF panel, FX timeseries
- Dominant language
- TypeScript
- Stars
- 86.6k
- Forks
- 13.1k
- Avg merge
- 8h 4m
- Merged PRs (30d)
- 825
Description
## Summary
Several market-analytics gaps remain that are **derived analytics** on data we already have (or free additions), distinct from the deferred REST-op exposure tracked in #4525:
1. **US Treasury yield curve via MCP** — #2249 seeded the full 1M→30Y curve from FRED, but the MCP `get_economic_data` tool only exposes `yield-curve-eu`. Add a `yield-curve-us` filter with derived **inversion flags** (2s10s, 3m10y, steepening/flattening deltas).
2. **BTC technicals** — SMA-50/200, golden/death cross, Mayer Multiple, distance from ATH. We seed BTC prices already; this is pure derivation.
3. **Bond ETF panel** — AGG / TLT / HYG / LQD / TIP prices + performance as a credit/duration stress read (HYG:LQD spread is a useful risk-off signal).
4. **FX timeseries + major crosses** — we expose spot ECB FX rates only; add historical timeseries with trend stats and an 8-major-crosses panel (EUR/USD, USD/JPY, GBP/USD, …) with a DXY proxy.
5. **Macro-regime composite verdict** — one weighted 0–100 score over signals we already hold (Fear & Greed, VIX, sector breadth, DXY, BTC trend, 10Y) with a discrete verdict (RISK_ON / CONSTRUCTIVE / NEUTRAL / DEFENSIVE / RISK_OFF). The *raw* signals are #4525's `get-macro-signals`; this is the derived synthesis, which is what agents actually want first.
6. **Country → primary index quote** — resolve a country ISO code to its main exchange index ticker (`src/config/markets.ts` / `finance-geo.ts` hold the mapping data) and return the live quote, so "how is Nigeria's market doing" is one call.
## Out of scope (already tracked in #4525)
- `get-macro-signals`, `get-bis-policy-rates`, `get-bis-exchange-rates`, `list-stablecoin-markets`, gold intelligence, hyperliquid flow, crypto sector lists — those are REST-backed deferred ops; do not duplicate.
## Proposed shape
- Derivations computed at seed time (seed-economy / market seeders) so MCP/REST serve cached results — no on-request computation.
- Expose through existing `get_market_data` / `get_economic_data` filters where natural; only add a new tool if the envelope gets crowded.
## Acceptance criteria
- [ ] US yield curve + inversion flags exposed via MCP filter with tests and docs.
- [ ] BTC technicals, bond ETF panel, FX timeseries/crosses seeded and exposed.
- [ ] No overlap with #4525 items (parity buckets stay consistent).
Contributor guide
Research direction
Start by reading src/config/markets.ts and finance-geo.ts for the country-to-index mapping, then inspect the seed-economy and market seeders and the existing get_market_data and get_economic_data filters. Break the proposal into scoped derivations and verify the relevant tests and docs cover the US yield curve, BTC, ETFs, FX, macro verdict, and country quote without duplicating #4525.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- analytics, api, backend, data, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100