Skip to content

Instantly share code, notes, and snippets.

@simbo1905
Last active May 30, 2026 14:00
Show Gist options
  • Select an option

  • Save simbo1905/e0e641da50ce2343951c31e6617a4958 to your computer and use it in GitHub Desktop.

Select an option

Save simbo1905/e0e641da50ce2343951c31e6617a4958 to your computer and use it in GitHub Desktop.
Margin Monitor UAT Test Methodology

Margin Monitor UAT Test Methodology

Objective

Prove that the Margin Monitor screen is a real working scenario engine — not a hardcoded display — by keying in the MD's exact scenario inputs and verifying the outputs match the golden dataset row by row.

Golden Dataset

Source: docs/MARGIN_MONITOR_GOLDEN_DATA.txt and docs/MARGIN_MONITOR_UAT_SPEC.md in the repo.

Scenario date: 2026-02-02

Swap rates (market inputs):

  • 2Y: 3.54213%
  • 5Y: 3.75728%
  • 10Y: 4.11643%
  • 15Y: 4.38296%
  • 20Y: 4.52466%
  • 30Y: 4.58643%
  • FFL: 4.48469% (average of 15Y and 30Y)

Target margin / threshold: 2.30%

Formula: Net Fee = Gross Fee - Swap Rate

Term → swap tenor mapping:

  • 2y → 2Y OIS
  • 3+2yr → 5Y OIS
  • 5y → 5Y OIS
  • 5+5yr → 10Y OIS
  • 10y → 10Y OIS
  • FFL → (15Y + 30Y) / 2

Live Endpoint

Citi swap rates served from dev1:

GET https://dev1-pricing-engine.livemoremortgages.com/v1/api/views/margin_monitor_citi_rates_history_vw?date=2026-02-02

Response for 2026-02-02 (rates in percent-space, e.g. 3.54 not 0.0354):

gbp_2y_par_ois_rate: 3.53866
gbp_5y_par_ois_rate: 3.75562
gbp_10y_par_ois_rate: 4.11757
gbp_15y_par_ois_rate: 4.38477
gbp_30y_par_ois_rate: 4.58857

These are the database defaults. The golden scenario rates are keyed in manually over the top.

Screen Under Test

https://dev1-pricing-engine.livemoremortgages.com/v1/margin_monitor.html?family=standard&group=0&date=2026-02-02&show_rates=1&show_charts=1&show_tables=1

Change family to rio and group to 0–6 to iterate across all product groups.

The screen has two filters: family (Standard / RIO) and product group. There is no purchase/remortgage dimension.

Test Method

For each product group in each family:

  1. Open the screen at the UAT date (2026-02-02) for that family and group.
  2. In the Market Inputs section, key in the exact swap rates from the golden dataset (2Y, 5Y, 10Y, 15Y, 20Y, 30Y).
  3. In the Product Inputs section, key in the exact gross fees from the golden dataset for that product group.
  4. Read the Net Fee row from the Product Outputs table.
  5. Compare each cell against the golden expected Net Fee within ±0.01% tolerance.

Proof the System is Not Hardcoded

After reading the passing outputs:

  1. Change one input (e.g. 2Y gross fee from 5.38% to 6.00%).
  2. Confirm the corresponding Net Fee moves by the expected delta (6.00 - 5.38 = 0.62%, so Net Fee rises from 1.84% to 2.46%).
  3. Restore the original value and confirm output returns to golden.

This proves the screen is computing live, not displaying stored answers.

Results

Standard family — 7 product groups × 5 terms = 35 cells: 35/35 PASS

Group 2Y 3+2YR 5Y 5+5YR 10Y
LM1 (0-60) 1.84% ✓ 1.92% ✓ 1.67% ✓ 1.87% ✓ 1.82% ✓
LM1 (75) 1.99% ✓ 2.02% ✓ 1.80% ✓ 1.97% ✓ 1.92% ✓
LM2 (0-60) 2.14% ✓ 2.12% ✓ 2.02% ✓ 2.07% ✓ 2.02% ✓
LM2 (75%) 2.24% ✓ 2.22% ✓ 2.12% ✓ 2.27% ✓ 2.22% ✓
LM2 (80%) 2.34% ✓ 2.32% ✓ 2.22% ✓ 2.27% ✓ 2.22% ✓
LM3 (75%) 2.84% ✓ 2.82% ✓ 2.72% ✓ 2.77% ✓ 2.72% ✓
LM4 (0-60) 2.84% ✓ 2.82% ✓ 2.72% ✓ 2.77% ✓ 2.72% ✓

RIO family — 7 product groups × 6 terms (includes FFL) = 42 cells: 42/42 PASS

Group 2Y 3+2YR 5Y 5+5YR 10Y FFL
LM1 (0-60) 2.05% ✓ 2.02% ✓ 1.82% ✓ 2.07% ✓ 2.02% ✓ 1.95% ✓
LM1 (75) 2.25% ✓ 2.12% ✓ 2.02% ✓ 2.17% ✓ 2.12% ✓ 2.05% ✓
LM2 (0-60) 2.25% ✓ 2.22% ✓ 2.02% ✓ 2.27% ✓ 2.22% ✓ 2.15% ✓
LM2 (75%) 2.45% ✓ 2.32% ✓ 2.22% ✓ 2.37% ✓ 2.32% ✓ 2.25% ✓
LM3 (0-60) 3.05% ✓ 3.02% ✓ 2.82% ✓ 3.07% ✓ 3.02% ✓ 2.95% ✓
LM3 (75%) 3.25% ✓ 3.12% ✓ 3.02% ✓ 3.17% ✓ 3.12% ✓ 3.05% ✓
LM4 (0-60) 3.35% ✓ 3.32% ✓ 3.12% ✓ 3.37% ✓ 3.32% ✓ 3.25% ✓

Total: 77/77 PASS

Live calculation proof: Changing 2Y gross fee from 5.38% to 6.00% moved 2Y Net Fee from 1.84% to 2.46% (delta +0.62%, matching 6.00 - 5.38). Restoring returned output to 1.84%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment