Challenge

Mortgage Bond Prepayment Risk Forecasting Stream with AI SDK & Mastra AI

AI-driven refinancing platforms accelerate mortgage prepayments, destabilizing traditional MBS yield models. Build an interactive AI SDK dynamic agent stream backed by Mastra AI workflow nodes to forecast prepayment velocity and portfolio interest rate sensitivity within sub-200ms latency limits.

Business OperationsHosted by Vera
Challenge brief

What you are building

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

Implement a streaming financial risk analysis engine using Vercel AI SDK data streaming and Mastra AI workflow components.

Delivery guide

How work is evaluated

Evaluation

Evaluates accuracy of dynamic CPR prepayment velocity and yield calculations in real-time response streams.

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

cpr_range_test

Ensures CPR calculation stays within expected quantitative limits

Binary check

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

Dimension 2

cpr_mean_absolute_error

MAE against theoretical prepayment benchmark model • target: 0.5 • range: 0-5

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

  • Stream dynamic MBS portfolio risk recalculations using Vercel AI SDK AI Stream response handlers.

  • Execute prepayment vector evaluations through embedded Mastra AI data nodes.

  • Calculate Conditional Prepayment Rates (CPR) under changing interest rate shocks.

  • Maintain real-time streaming latency under 200 milliseconds.

Resources and assets

Reference links and supporting material

Dataset notes

Historical and synthetic MBS pool data, current interest rate curves, and simulated AI refinancing adoptability ratios.

How this agent runs

Evaluates accuracy of dynamic CPR prepayment velocity and yield calculations in real-time response streams.

Challenge input

JSON containing pool_wac, current_rate, ai_refi_penetration

AI SDK

Framework assignment for streaming multi-provider dynamic agent UI integration.

Mastra AI

Additional tool for complex workflow step coordination.

Evaluated output

JSON with projected_cpr, price_duration_impact

Checks for
  • Ensures CPR calculation stays within expected quantitative limits
  • MAE against theoretical prepayment benchmark model • target: 0.5 • range: 0-5
Proof of success
  • Benchmark: FinRisk-Stream-Bench
  • Cpr Mean Absolute Error target: 0.5
  • 1 public reference case
Runtime evidence
  • JavaScript execution harness
  • javascript sandbox (unavailable on Versalist)
View technical recipe

Configured tools

Action Space
  • Mastra AI · Required
  • Hamming · Optional
Observation
  • Arize Phoenix · Optional
Reward / Eval
  • Arize Phoenix · Optional
Orchestration
  • Mastra AI · Required

Evaluation contract

  • cpr_range_test · Weight 1
  • cpr_mean_absolute_error · Weight 1

Recipe state

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

Frequently Asked Questions about Mortgage Bond Prepayment Risk Forecasting Stream with AI SDK & Mastra AI