Skip to content

Add BIS central bank data integration (policy rates, exchange rates, credit)#363

Merged
koala73 merged 3 commits intomainfrom
claude/add-bis-policy-tracker-HUzO7
Feb 25, 2026
Merged

Add BIS central bank data integration (policy rates, exchange rates, credit)#363
koala73 merged 3 commits intomainfrom
claude/add-bis-policy-tracker-HUzO7

Conversation

@koala73
Copy link
Owner

@koala73 koala73 commented Feb 25, 2026

Summary

Adds integration with Bank for International Settlements (BIS) SDMX API to provide three new economic data streams:

  • Policy Rates: Central bank policy rates for major economies (monthly)
  • Exchange Rates: Real and nominal effective exchange rate indices (monthly)
  • Credit-to-GDP: Total credit as percentage of GDP (quarterly)

Implements three new RPC endpoints, client/server code generation, UI panel with tabbed display, and i18n support across 13 languages.

Type of change

  • New feature
  • New data source / feed

Affected areas

  • API endpoints (/api/*)
  • Market Radar / Crypto (Economic Panel)
  • Config / Settings

Changes

Backend

  • New RPC handlers (server/worldmonitor/economic/v1/):

    • get-bis-policy-rates.ts — Fetches central bank policy rates from BIS WS_CBPOL dataset
    • get-bis-exchange-rates.ts — Fetches effective exchange rate indices from BIS WS_EER dataset
    • get-bis-credit.ts — Fetches credit-to-GDP ratios from BIS WS_TC dataset
    • _bis-shared.ts — Shared CSV fetch/parse utilities, country mappings, and BIS API helpers
  • Proto definitions (proto/worldmonitor/economic/v1/):

    • bis_data.proto — Message types for policy rates, exchange rates, and credit data
    • get_bis_policy_rates.proto, get_bis_exchange_rates.proto, get_bis_credit.proto — RPC request/response messages
    • Updated service.proto to register three new RPC methods
  • Generated code (client & server):

    • TypeScript interfaces and client methods in src/generated/client/ and src/generated/server/
    • Service handler interface and route registration in server

Frontend

  • EconomicPanel (src/components/EconomicPanel.ts):

    • New "Central Banks" tab (🏦) alongside existing Indicators, Oil, and Government Spending tabs
    • updateBis() method to receive and render BIS data
    • renderCentralBanks() method with three sections: Policy Rates (sorted by rate), Real EER, and Credit-to-GDP
    • Color-coded change indicators (green for cuts/decreases, red for hikes/increases)
  • Economic service (src/services/economic/index.ts):

    • Three new circuit breakers for BIS endpoints with 30-min cache (policy/EER) and 12-hour cache (credit)
    • fetchBisData() function that calls all three BIS endpoints in parallel
    • BisData type aggregating policy rates, exchange rates, and credit entries
  • Data loader (src/app/data-loader.ts):

    • loadBisData() method integrated into main data loading pipeline
    • Scheduled refresh task for BIS data
  • i18n (src/locales/*.json):

    • Added 10 new translation keys across 13 languages:
      • centralBanks, noBisData, policyRate, exchangeRate, creditToGdp, realEer, change, cut, hike, hold

Data Integration

  • Curated country list (12 major economies): US, GB, JP, XM (Euro Area), CH, SG, IN, AU, CN, CA, KR, BR
  • Caching: Redis-backed with 6-hour TTL for monthly data, 12-hour for quarterly
  • Error handling: Graceful fallback to empty data on fetch failure; automatic retry via circuit breaker

Checklist

  • Tested on worldmonitor.app variant
  • No API keys or secrets committed
  • TypeScript compiles without errors
  • Proto definitions follow existing patterns

Add a new "Central Banks" tab to the Economic panel powered by the BIS
(Bank for International Settlements) free SDMX REST API. Displays policy
rates, effective exchange rates, and credit-to-GDP ratios for 12 major
central banks (Fed, ECB, BOE, BOJ, SNB, MAS, RBI, RBA, PBOC, BOC, BOK,
BCB).

- Proto: 4 new files (bis_data, get_bis_policy_rates, get_bis_exchange_rates,
  get_bis_credit) + 3 RPCs added to EconomicService
- Server: shared CSV fetch/parse helper using papaparse, 3 handlers with
  Redis caching (6h/12h TTL), batched single-request per dataset
- Frontend: 3 separate circuit breakers, fetchBisData() with Promise.all
- UI: Central Banks tab with policy rates (sorted by rate, colored by
  cut/hike/hold), real EER indices, and credit-to-GDP ratios
- Integration: 'bis' DataSourceId, BIS in StatusPanel WORLD_APIS, 60min
  refresh interval, data loader wiring
- i18n: BIS keys added to all 17 locale files

No API key required — BIS is free/public. All BIS-derived text rendered
via escapeHtml() to prevent XSS.

https://claude.ai/code/session_01N73WokR4NPuSg8JpPz7nYZ
- Fix double '?' in fetchBisCSV URL construction (format=csv was silently ignored)
- Add error logging to all 3 BIS server handlers (previously silent catch blocks)
- Fix misleading "BIS data loading..." empty state to "temporarily unavailable - will retry"
- Remove unused nominal EER fetch to save bandwidth (only real EER is displayed)
- Fix previousRatio rounding inconsistency in credit-to-GDP fallback path

https://claude.ai/code/session_01N73WokR4NPuSg8JpPz7nYZ
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worldmonitor Ready Ready Preview, Comment Feb 25, 2026 10:12am
worldmonitor-finance Building Building Feb 25, 2026 10:12am
worldmonitor-happy Ready Ready Preview, Comment Feb 25, 2026 10:12am
worldmonitor-startup Ready Ready Preview, Comment Feb 25, 2026 10:12am

Request Review

@koala73 koala73 merged commit 752e35f into main Feb 25, 2026
5 checks passed
koala73 added a commit that referenced this pull request Feb 25, 2026
The WTO trade handlers used fabricated indicator codes (QR, SPS, TBT,
HS_M_0010) that don't exist in the WTO Timeseries API, causing all
four RPCs to silently return empty data.

Fixes:
- Tariffs: HS_M_0010 → TP_A_0010; remove partner param (tariff
  indicators lack partner dimension, caused 400 error)
- Trade flows: split comma-separated indicators into parallel
  requests (API truncates combined i= values)
- Restrictions: rewrite to use tariff overview across 15 major
  economies (QR API is a separate subscription product)
- Barriers: rewrite to use agricultural vs non-agricultural tariff
  gap analysis (ePing SPS/TBT API is separate subscription)
- Handle 204 No Content (valid query, no data) instead of treating
  as error

Also: disable Global Giving panel by default for non-happy variants,
update README for BIS + WTO features (PR #363, #364).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants