Skip to main content
Challenge

AI-Driven Mortgage Prepayment Shock Forecasting System using LangChain & Claude 4 Opus

Mortgage bond investors suffer unexpected yield decay when AI loan-refinancing applications cause spikes in pool prepayment rates. Construct a time-series evaluation agent using LangChain and Claude 4 Opus to project prepayment speeds (CPR) under changing yield curves. Achieve mean absolute error under 1.5% CPR across synthetic MBS pools.

Business OperationsHosted by Vera
Challenge brief

What you are building

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

Build a LangChain financial forecasting chain leveraging Claude 4 Opus to predict residential mortgage bond prepayment shocks under dynamic interest rate shifts.

Delivery guide

How work is evaluated

Evaluation

Measures prediction precision of calculated CPR rates under specific interest rate drop 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

prepayment_flag_match

Checks correct identification of prepayment shock status

Binary check

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

Dimension 2

cpr_mae

Mean Absolute Error of predicted CPR rate against baseline market standard • target: 0.015 • range: 0-0.05

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

  • Construct custom LangChain `Runnable` chains to orchestrate interest rate scenario prompts and financial forecasting tools

  • Leverage Anthropic Claude 4 Opus (`ChatAnthropic`) for reasoning over complex macroeconomic signals and borrower AI-refi behavior

  • Calculate Conditional Prepayment Rate (CPR) and Single Monthly Mortality (SMM) metrics dynamically

  • Evaluate scenario sensitivity under parallel yield curve shifts (+/- 100 bps)

Resources and assets

Reference links and supporting material

Dataset notes

Mortgage backed security pool characteristics including coupon rates, vintage years, and historical prepayment speeds.

Challenge setup

Measures prediction precision of calculated CPR rates under specific interest rate drop scenarios.

Challenge input

JSON containing wac, weighted_average_maturity, current_mortgage_rate, rate_drop_bps

LangChain

Framework for constructing structured prompt-chaining pipelines.

Claude 4 Opus

Advanced frontier LLM for complex macro-financial reasoning.

Evaluated output

JSON containing predicted_cpr, smm, prepayment_shock_flag

Evaluation checks
  • Checks correct identification of prepayment shock status
  • Mean Absolute Error of predicted CPR rate against baseline market standard • target: 0.015 • range: 0-0.05
Configured evaluation evidence
  • Benchmark: MBS Prepayment Analytics Benchmark
  • Cpr Mae target: 0.015
  • 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
  • LangChain · Required
  • Langchain · Optional
Policy Serving
  • Claude 4 Opus · Optional
Orchestration
  • LangChain · Required
  • Langchain · Optional

Evaluation contract

  • prepayment_flag_match · Weight 1
  • cpr_mae · Weight 1

Metrics

  • cpr_mae · Target 0.015

Benchmarks

  • MBS Prepayment Analytics Benchmark
  • general

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON containing wac, weighted_average_maturity, current_mortgage_rate, rate_drop_bps

    Output: JSON containing predicted_cpr, smm, prepayment_shock_flag

    Execution harness: Python

Evaluation tools

  • LangChain · agent_framework
  • Claude 4 Opus · llm_model

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about AI-Driven Mortgage Prepayment Shock Forecasting System using LangChain & Claude 4 Opus