Skip to content

Market rates ingestion & normalisation

ID MOD-085
System SD06
Repo bank-risk-platform
Build status Deployed
Deployed Yes
Last commit 54197c02fff0ca78a988e6140d31778e59f05b46

Purpose

MOD-085 is the single point of ingestion for all external market reference data consumed by the bank's analytical, risk, and operational systems. It owns the normalisation layer that makes consumers provider-agnostic, and the write-back path that makes Snowflake-sourced FX spot available to Postgres-based operational modules.

What it does

Snowflake Marketplace normalisation. The module subscribes to one or more Marketplace provider data shares (FX spot, FX forward curves, swap/OIS curves, benchmark rates). Snowflake Dynamic Tables in the market.* schema translate provider-specific column names, decimal conventions, and timestamp formats into a canonical form. Downstream consumers read only from market.* — they are never coupled to the provider schema.

The canonical market.* tables produced are:

Table Content Typical refresh
market.fx_spot_current Latest mid-rate per currency pair 5–15 min (provider)
market.fx_forward_curve Tenor points ON/TN/1W/1M/3M/6M/1Y per pair EOD
market.swap_curve AUD and NZD par swap rates 3M–10Y EOD
market.ois_curve SOFR, SONIA, BBSW, BKBM overnight index swap rates EOD
market.benchmark_rates RBA OCR, RBNZ OCR, BBSW, BKBM daily fixes Daily

BKBM direct feed. A scheduled Lambda runs on each New Zealand business day to fetch BKBM from the NZFMA HTTPS endpoint. The rate is loaded into market.benchmark_rates. If the feed is unavailable, the previous business day's rate is carried forward with a data quality flag; an alert fires if the carry-forward persists for more than one day.

Operational FX write-back. After each market.fx_spot_current refresh, a write-back Lambda upserts the latest spot mid-rate for all supported currency pairs into payments.fx_rates in the SD04 Postgres database. On successful upsert, a bank-platform.market_rates_updated EventBridge event is emitted. SD04 operational modules (MOD-025 rate lock, MOD-071 payment validation) consume from Postgres, not Snowflake, ensuring the payment path is never inline on Snowflake query latency.

Provider abstraction

Provider selection is a procurement decision with no architectural consequence. The normalisation Dynamic Tables are the only code that references provider column names. Swapping or supplementing a provider requires updating those tables only — no consumer changes. See ADR-039 for the rationale and the BKBM exception.

Compliance context

All ingestion events are logged with provider identifier, data version, and ingestion timestamp. Any market rate used in a regulatory calculation (LCR, NSFR, ECL, ILAAP stress test, prudential return) is traceable back to its source version via this log. This satisfies audit requirements for REP-005 and supports ILAAP data lineage obligations.

Streamlit dashboard

MOD-085 ships a Streamlit page MARKET.STREAMLIT_RATES_DASHBOARD providing: - Current market rates by currency pair (NZD/USD, AUD/USD, NZD/AUD) and tenor (ON, 1W, 1M, 3M, 6M, 1Y) - Rate history charts over 30 and 90 days - SOFR, BKBM, BBSW rate term structure - Data freshness indicator (last ingestion timestamp per source)

Consumed by MOD-171 (Risk Intelligence Dashboard) as market rate context in the IRRBB sensitivity page. Cross-schema SELECT on MARKET.* published views required for RISK_INTELLIGENCE_ROLE.


Module dependencies

Depends on

Module Title Required? Contract Reason
MOD-104 AWS shared infrastructure bootstrap Required MOD-104 provisions the S3 Iceberg bucket (Snowflake external tables), KMS key, and bank-risk-platform EventBridge bus ARN. Required before this module can be deployed.
MOD-102 Snowflake account configuration & governance Required Snowflake account and governance provisioned by MOD-102 must exist before this module can read or write Snowflake.
MOD-171 Risk Intelligence Dashboard Required Risk Intelligence Dashboard uses market rate context from MOD-085 in the IRRBB sensitivity page.

Required by

Module Title As Contract
MOD-025 FX rate lock & conversion Hard dependency
MOD-032 LCR / NSFR calculator Hard dependency contract/dbt/
MOD-035 IRRBB / EVE / NII model Hard dependency contract/dbt/
MOD-082 Nostro & FX treasury management Hard dependency
MOD-086 Funds transfer pricing engine Hard dependency contract/dbt/
MOD-115 Property security and LVR management Optional enhancement contract/events/
MOD-116 Mortgage servicing engine Optional enhancement contract/events/
MOD-162 Loan facility & component manager Hard dependency
MOD-163 Break-cost calculator Hard dependency contract/events/
MOD-165 Synthetic swap book aggregator Hard dependency
MOD-171 Risk Intelligence Dashboard Optional enhancement

Policies satisfied

Policy Title Mode How
REP-005 Data Quality & Assurance Policy LOG All market data ingestion events are logged with provider, version, and timestamp — full audit trail for any rate used in regulatory calculations or product pricing.
CLQ-002 Liquidity Risk Management Policy CALC Swap and OIS curves sourced by this module are inputs to the LCR and NSFR Dynamic Tables — data quality failures block liquidity ratio computation.

Capabilities satisfied

Capability Title Mode How
CAP-132 CAP-132 AUTO Subscribes to Snowflake Marketplace provider shares for FX spot, FX forward curves, swap/OIS curves, and benchmark rates; normalises all feeds into the canonical market.* Snowflake schema via Dynamic Tables; fetches BKBM from NZFMA daily; writes FX spot to SD04 Postgres and fires bank-platform.market_rates_updated.

Part of SD06 — Snowflake Analytics & Risk Platform Compiled 2026-05-22 from source/entities/modules/MOD-085.yaml