Skip to main content
Challenge

Build Residential Loan Portfolio Stress-Tester using Pydantic AI

Prudential's target $3 billion home improvement portfolio exposes investors to macroeconomic fluctuations in mortgage interest rates and home equity levels. Developers will build a typed stress-testing agent using Pydantic AI. The agent subjects a portfolio of home improvement loans to various economic shock scenarios (e.g., +200 bps rate hikes, 10% home price drops) and generates structured risk reports detailing expected default loss rates.

Business OperationsHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Construct a type-safe residential loan portfolio stress-testing agent using Pydantic AI.

Delivery guide

How work is evaluated

Evaluation

Evaluates accuracy of expected loss calculations under specific rate/hpi shock scenarios.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

Loss Amount Calculation

Ensures projected_loss_amount matches total_portfolio_value * projected_cdr_pct

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

Precision Metric

Fidelity of stress calculation • target: 1 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Define strict Pydantic schemas for macro-stress test inputs and portfolio output metrics

  • Implement multi-scenario financial loss projection logic inside Pydantic AI agents

  • Calculate portfolio Cumulative Default Rate (CDR) and Loss Given Default (LGD)

  • Output structured compliance reports for institutional risk oversight committees

Resources and assets

Reference links and supporting material

Dataset notes

Dataset of 20 portfolio stress-test scenarios with varying interest rate shocks and HPI movements.

Challenge setup

Evaluates accuracy of expected loss calculations under specific rate/hpi shock scenarios.

Challenge input

JSON with total_portfolio_value, avg_cltv, rate_shock_bps, hpi_drop_pct

Pydantic AI

Required framework for typed outputs.

Evaluated output

JSON with projected_cdr_pct, projected_loss_amount, stress_rating

Evaluation checks
  • Ensures projected_loss_amount matches total_portfolio_value * projected_cdr_pct
  • Fidelity of stress calculation • target: 1 • range: 0-1
Configured evaluation evidence
  • Benchmark: CreditStressBench
  • Precision Metric target: 1
  • 1 public reference case
Configured runtime
  • Python execution harness
  • Python sandbox (unavailable on Versalist)

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Action Space
  • Pydantic AI · Required
  • Coplay AI · Optional
  • StackAI · Optional
Orchestration
  • Pydantic AI · Required

Evaluation contract

  • Loss Amount Calculation · Weight 1
  • Precision Metric · Weight 1

Metrics

  • Precision Metric · Target 1

Benchmarks

  • CreditStressBench
  • general

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON with total_portfolio_value, avg_cltv, rate_shock_bps, hpi_drop_pct

    Output: JSON with projected_cdr_pct, projected_loss_amount, stress_rating

    Execution harness: Python

Evaluation tools

  • Pydantic AI · Agent Framework

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Build Residential Loan Portfolio Stress-Tester using Pydantic AI