This project implements an end-to-end batch analytics pipeline for foreign exchange (FX) data using the Bank of Canada Valet API.
The platform ingests daily FX observations, stores them in a cloud data warehouse, transforms them using analytics engineering best practices, and exposes analytics-ready tables for visualization and exploration.
The goal of the project is to demonstrate real-world data engineering patterns, including:
- API ingestion
- Incremental and idempotent batch processing
- Warehouse-first modeling
- Analytics feature engineering
- Orchestration and data quality testing
Source → Raw → Staging → Analytics → Dashboard
- Source: Bank of Canada Valet API (FX observations)
- Raw: Incrementally ingested, partitioned BigQuery tables
- Staging: Cleaned and typed dbt models
- Analytics: Fact and feature marts optimized for analysis
- Visualization: Looker Studio dashboard
FX data is pulled from the Bank of Canada Valet API using a Python ingestion module.
- Supports incremental loads based on the latest loaded date
- Supports manual historical backfills
- Loads data into a staging table and merges into the raw table
- Ensures idempotency via BigQuery
MERGE
raw.boc_fx_observations
- Partitioned by
observation_date - Clustered by
series_id - One row per currency pair per day
Transformations are implemented using dbt following analytics engineering best practices.
staging.stg_boc_fx_observations
- Cleans and types raw FX observations
- Enforces non-null constraints
- Acts as the canonical, trusted source for downstream models
analytics.fct_fx_rates_daily
- One row per currency pair per day
- Primary fact table for FX analysis
analytics.fct_fx_features
Derived analytical features:
- Daily absolute change
- Daily percentage change
- 7-day moving average
- 14-day rolling standard deviation (volatility proxy)
These features support trend analysis, volatility analysis, and visualization.
Data quality is enforced using dbt tests:
not_nullchecks on key fields- Uniqueness constraints on
(series_id, observation_date) - Source freshness checks on raw ingestion
This ensures reliability and trust in downstream analytics.
This project includes an Apache Airflow DAG that orchestrates:
- FX data ingestion into BigQuery
dbt rundbt test
The DAG is designed for production deployment (e.g., Cloud Composer) and supports:
- Scheduled incremental runs
- Manual backfill execution via DAG parameters
Airflow is not required to be installed locally to run the core pipeline logic.
Analytics tables are visualized using Looker Studio, connected directly to BigQuery.
The dashboard includes:
- FX rates over time
- Daily changes
- Trend vs smoothed averages
- Volatility over time
Screenshot available in
docs/images/dashboard.png
This project implements an end-to-end batch analytics pipeline for foreign exchange (FX) data using the Bank of Canada Valet API.
The platform ingests daily FX observations, stores them in a cloud data warehouse, transforms them using analytics engineering best practices, and exposes analytics-ready tables for visualization and exploration.
The goal of the project is to demonstrate real-world data engineering patterns, including:
- API ingestion
- Incremental and idempotent batch processing
- Warehouse-first modeling
- Analytics feature engineering
- Orchestration and data quality testing
Source → Raw → Staging → Analytics → Dashboard
- Source: Bank of Canada Valet API (FX observations)
- Raw: Incrementally ingested, partitioned BigQuery tables
- Staging: Cleaned and typed dbt models
- Analytics: Fact and feature marts optimized for analysis
- Visualization: Looker Studio dashboard
FX data is pulled from the Bank of Canada Valet API using a Python ingestion module.
- Supports incremental loads based on the latest loaded date
- Supports manual historical backfills
- Loads data into a staging table and merges into the raw table
- Ensures idempotency via BigQuery
MERGE
raw.boc_fx_observations
- Partitioned by
observation_date - Clustered by
series_id - One row per currency pair per day
Transformations are implemented using dbt following analytics engineering best practices.
staging.stg_boc_fx_observations
- Cleans and types raw FX observations
- Enforces non-null constraints
- Acts as the canonical, trusted source for downstream models
analytics.fct_fx_rates_daily
- One row per currency pair per day
- Primary fact table for FX analysis
analytics.fct_fx_features
Derived analytical features:
- Daily absolute change
- Daily percentage change
- 7-day moving average
- 14-day rolling standard deviation (volatility proxy)
These features support trend analysis, volatility analysis, and visualization.
Data quality is enforced using dbt tests:
not_nullchecks on key fields- Uniqueness constraints on
(series_id, observation_date) - Source freshness checks on raw ingestion
This ensures reliability and trust in downstream analytics.
This project includes an Apache Airflow DAG that orchestrates:
- FX data ingestion into BigQuery
dbt rundbt test
The DAG is designed for production deployment (e.g., Cloud Composer) and supports:
- Scheduled incremental runs
- Manual backfill execution via DAG parameters
Airflow is not required to be installed locally to run the core pipeline logic.
Analytics tables are visualized using Looker Studio, connected directly to BigQuery.
The dashboard includes:
- FX rates over time
- Daily changes
- Trend vs smoothed averages
- Volatility over time
Screenshot available in
docs/images/dashboard.png
boc-fx-analytics/ ├── ingestion/ # API ingestion and BigQuery load logic ├── dbt/ # dbt project (staging + marts) ├── airflow/ # Airflow DAG (orchestration) ├── sql/ # Ad-hoc and exploratory SQL queries ├── docs/ │ └── images/ # Architecture & dashboard screenshots ├── requirements.txt └── README.md
gcloud auth application-default loginpython -m venv .venv
source .venv/Scripts/activatepip install -r requirements.txtpython -m ingestion.run_ingestioncd dbt/boc_fx_analytics
dbt run
dbt test-
API-based data ingestion
-
Incremental batch processing
-
BigQuery partitioning and clustering
-
Idempotent data pipelines using MERGE
-
Analytics engineering with dbt
-
Feature engineering for time-series data
-
Data quality testing and freshness checks
-
Workflow orchestration with Airflow
-
BI visualization with Looker Studio
-
The pipeline is designed for batch processing, reflecting real-world end-of-day financial data ingestion.
-
Airflow and dbt are decoupled from ingestion logic to ensure modularity and reusability.
-
The project emphasizes correctness, rerunnability, and clarity over low-latency streaming.

