Metric Schema Reference
Complete field reference for the MetricRegistry definition format.
Field Reference
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Fully qualified metric ID (e.g. uk.banking.capital.cet1_ratio) | |
| version | semver | Semantic version of this metric definition | |
| schema_version | integer | Schema format version (currently 1) | |
| title | string | Human-readable metric name | |
| description | string | One-line summary of what this metric measures | |
| certification | enum | Lifecycle status: draft, pending_review, certified, deprecated | |
| formula.dialect | string | SQL dialect (ansi, postgres, bigquery, etc.) | |
| formula.sql | string | The canonical SQL formula with template variables | |
| inputs[] | array | List of input datasets with columns required | |
| inputs[].dataset | string | Template variable name for the source table | |
| inputs[].columns[] | array | Template variable names for required columns | |
| output.column | string | Name of the output column produced | |
| output.type | string | Data type of output (numeric, integer, text, etc.) | |
| output.unit | string | Unit of measure (ratio, percentage, gbp, tonnes_co2e, etc.) | |
| frequency | string | -- | How often this metric is typically reported |
| thresholds[] | array | -- | Regulatory or internal thresholds (type, value, source) |
| regulatory_source | object | -- | Source framework, URL, excerpt, section reference, caveats |
| provenance.source_excerpt | string | -- | Verbatim text from the source document |
| provenance.calculation_notes | string | -- | Notes on implementation details or edge cases |
| provenance.caveats | string | -- | Known limitations or jurisdictional variations |
Certification Lifecycle
Initial definition, may be incomplete
Submitted for expert validation
Validated by domain expert, production-ready
Superseded or no longer applicable
Template Variable Syntax
All formulas use ${variable_name} placeholders instead of hardcoded table or column names. This ensures metric definitions are schema-agnostic and portable across different data warehouses.
Each variable in the formula maps to an entry in the inputs array. When implementing the metric, substitute each variable with your actual table and column names.
Zero Fabrication Policy
Every metric in the registry must trace to a verifiable primary source. No metric definition may contain fabricated regulatory references, invented thresholds, or unverifiable source excerpts. If a value cannot be verified, it must be marked as null with a caveat explaining why.
Complete Example
id: uk.banking.capital.cet1_ratio
version: 0.1.0
schema_version: 1
title: CET1 Ratio
description: >
Common Equity Tier 1 capital as percentage
of risk-weighted assets
certification: draft
formula:
dialect: ansi
sql: >
SELECT ${cet1_capital} / nullif(${rwa}, 0)
AS cet1_ratio
FROM ${capital}
inputs:
- dataset: capital
columns:
- cet1_capital
- rwa
output:
column: cet1_ratio
type: numeric
unit: ratio
frequency: quarterly
thresholds:
- type: regulatory_minimum
value: 0.045
source: CRR Article 92(1)(a)
- type: buffer_requirement
value: 0.025
source: CRR Article 129
regulatory_source:
framework: CRR Article 92(2)(a)
url: https://legislation.gov.uk/eur/2013/575
excerpt: >
The CET1 capital ratio shall be the CET1
capital expressed as a percentage of the
total risk exposure amount.
caveats: >
Transitional provisions may apply.
Check PRA PS1/26 for UK-specific rules.
provenance:
source_excerpt: >
"The CET1 capital ratio shall be the CET1
capital expressed as a percentage of the
total risk exposure amount."
calculation_notes: >
Uses nullif to guard against division by
zero when RWA is reported as zero.
caveats: >
Different jurisdictions may have different
minimum requirements.