Skip to content

feat(seeds): expand IMF WEO (labor, growth, external) — priority #1, all consumers exist #3027

@koala73

Description

@koala73

Background

PR #3020 migrated WorldMonitor's IMF fetching to the SDMX 3.0 API (api.imf.org). Current coverage seeds only 6 indicators across fiscal-space, imf-macro, and national-debt seeders:

  • PCPIPCH (CPI inflation)
  • BCA_NGDPD (current account % GDP)
  • GGR_NGDP (gov revenue % GDP)
  • GGXCNL_NGDP (fiscal balance % GDP)
  • GGXWDG_NGDP (gov debt % GDP)
  • NGDPD (nominal GDP USD)

WEO publishes ~145 indicators per country. Expanding coverage unlocks labor, growth, external balance, and per-capita dimensions across ~210 countries at zero incremental API cost (same imfSdmxFetchIndicator helper).

Rescope (2026-04-13): why this is priority #1

This is the highest-ROI of the 4 seeder expansion issues (#3025#3028). All consumers already exist — no new panels needed, just more data feeding cards that currently show sparse tiles.

Concrete plug-ins in existing code

Indicator Consumer Effect
NGDP_RPCH (real GDP growth) CountryDeepDivePanel → Economic Indicators card Adds growth rate to mostly-empty tile
LUR (unemployment %) Economic Indicators card + resilience macroFiscal dimension New labor sub-metric in scorer
NGDPDPC (nominal GDP/capita USD) Economic Indicators + Country Facts Per-capita context
PPPPC (PPP GDP/capita) Country Facts + regional peer rankings Normalization denominator
LP (population, millions) Country Facts card Basic demographic tile
NID_NGDP / NGSD_NGDP Resilience macroFiscal Savings-investment gap → external deficit pressure sub-metric
PCPI / PCPIEPCH ConsumerPricesPanel fallback Filling PCPIPCH gaps
GGX, GGXONLB_NGDP National Debt card Primary balance + total expenditure
BX, BM, BCA Trade Flows card BOP balances
TM_RPCH, TX_RPCH Trade Flows card Volume growth

New conclusions derivable

  • Stagflation flag: PCPIPCH up + NGDP_RPCH down → surface in country brief
  • Regional peer rank: GDP growth / unemployment / inflation rank within region
  • External imbalance: savings–investment gap as leading indicator for BOP crises

Technical notes

The SDMX 3.0 fetcher already exists in scripts/_seed-utils.mjs:

import { imfSdmxFetchIndicator } from './_seed-utils.mjs';
const data = await imfSdmxFetchIndicator('NGDP_RPCH', { years: ['2024', '2025', '2026'] });
// → { USA: { '2024': 2.8, '2025': 2.1, ... }, GBR: {...}, ... }
  • Agency: IMF.RES, Database: WEO
  • URL pattern: https://api.imf.org/external/sdmx/3.0/data/dataflow/IMF.RES/WEO/+/*.{INDICATOR}.A
  • Country format: ISO3, ~207-210 countries per indicator
  • Retry: already wrapped in withRetry(fn, 2, 2000)
  • No proxy needed, no API key

Proposed structure

Split seeders by theme (Option B from original spec):

  • seed-imf-growth.mjsNGDP_RPCH, NGDPDPC, NGDP_R, PPPPC, PPPGDP, NID_NGDP, NGSD_NGDPeconomic:imf:growth:v1
  • seed-imf-labor.mjsLUR, LPeconomic:imf:labor:v1
  • seed-imf-external.mjsBX, BM, BCA, TM_RPCH, TX_RPCHeconomic:imf:external:v1
  • Extend seed-imf-macro.mjs with PCPI, PCPIEPCH, GGX, GGXONLB_NGDP

Bundle via seed-bundle-imf-extended.mjs (already-existing bundle pattern on Railway).

Acceptance criteria

  • New seeders fetching 15+ additional WEO indicators across ~207 countries
  • Redis keys grouped by theme (economic:imf:growth:v1, :labor:v1, :external:v1)
  • 35-day TTL (monthly WEO release cadence)
  • Wire into bootstrap + health registries (SEED_META)
  • Update CountryDeepDivePanel Economic Indicators + Country Facts cards to render new fields
  • Add LUR as a macroFiscal sub-metric in _indicator-registry.ts
  • Test coverage: at least one test per new seeder + panel rendering with populated data

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: APIBackend API, sidecar, keysenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions