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.
What you are building
Construct a type-safe residential loan portfolio stress-testing agent using Pydantic AI.
How work is evaluated
Evaluates accuracy of expected loss calculations under specific rate/hpi shock scenarios.
Datasets
Public datasets, plus the private datasets you have access to.
How submissions are scored
Loss Amount Calculation
Ensures projected_loss_amount matches total_portfolio_value * projected_cdr_pct
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
Precision Metric
Fidelity of stress calculation • target: 1 • range: 0-1
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
Learning goals
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
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
- Ensures projected_loss_amount matches total_portfolio_value * projected_cdr_pct
- Fidelity of stress calculation • target: 1 • range: 0-1
- Benchmark: CreditStressBench
- Precision Metric target: 1
- 1 public reference case
- Python execution harness
- Python sandbox (unavailable on Versalist)
Shows the first task, up to three tools, and up to three evidence items.
View technical recipe
Configured tools
- Pydantic AI · Required
- Coplay AI · Optional
- StackAI · Optional
- 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
- 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.