Challenge

MBS AI-Prepayment Risk Validator using Pydantic AI and Claude 4 Opus

Mortgage-backed security (MBS) investors face yield compression due to automated AI refinancing tools accelerating borrower prepayment velocities. Build a type-safe Pydantic AI agent powered by Claude 4 Opus to calculate Single Monthly Mortality (SMM) prepayment shocks with under 2% error.

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 Pydantic AI agent with Claude 4 Opus to model AI-driven mortgage prepayment shocks and predict collateralized mortgage obligation tranche duration compression.

Delivery guide

How work is evaluated

Evaluation

Evaluates Pydantic AI agent outputs against target SMM prepayment speeds and tranche duration shifts.

Datasets

Shared data for this challenge

Review public datasets and any private uploads tied to your build.

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

Schema Validation Pass

Ensures Pydantic AI schema validation passes with zero errors.

Binary check

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

Dimension 2

cpr_error_mae

Mean Absolute Error of predicted CPR rate against financial benchmark target • target: 0.01 • range: 0-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

  • Build a Pydantic AI agent with strict typing and schema validation for financial data structures.

  • Utilize Claude 4 Opus reasoning to evaluate mortgage interest rate incentive spreads.

  • Compute Single Monthly Mortality (SMM) and Conditional Prepayment Rate (CPR) under AI-refinancing conditions.

  • Validate collateralized mortgage obligation (CMO) bond tranche duration impact.

Resources and assets

Reference links and supporting material

Dataset notes

Dataset of 50 mortgage pool profiles with varying interest rate incentives, borrower AI-refinancing app adoption rates, historical CPRs, and bond tranche details.

How this agent runs

Evaluates Pydantic AI agent outputs against target SMM prepayment speeds and tranche duration shifts.

Challenge input

JSON containing note_rate, current_market_rate, ai_adoption_rate, and original_duration_years

Pydantic AI

Mandatory framework for strongly-typed AI agent execution.

Claude 4 Opus

Required frontier model for complex financial mathematical reasoning.

Evaluated output

JSON matching Pydantic model with predicted_cpr, predicted_smm, and revised_duration_years

Checks for
  • Ensures Pydantic AI schema validation passes with zero errors.
  • Mean Absolute Error of predicted CPR rate against financial benchmark target • target: 0.01 • range: 0-0.1
Proof of success
  • Benchmark: Fixed Income Prepayment Benchmark
  • Cpr Error Mae target: 0.01
  • 1 public reference case
Runtime evidence
  • Python execution harness
  • Python sandbox (unavailable on Versalist)
View technical recipe

Configured tools

Action Space
  • Pydantic AI · Required
  • Weights & Biases · Optional
Policy Serving
  • Claude 4 Opus · Optional
Orchestration
  • Pydantic AI · Required

Evaluation contract

  • Schema Validation Pass · Weight 1
  • cpr_error_mae · Weight 1

Recipe state

This is a preview. The configuration can change before the evaluation recipe is locked.

Frequently Asked Questions about MBS AI-Prepayment Risk Validator using Pydantic AI and Claude 4 Opus