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.
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.
How work is evaluated
Evaluates accuracy of dynamic CPR prepayment velocity and yield calculations in real-time response streams.
Shared data for this challenge
Review public datasets and any private uploads tied to your build.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
cpr_range_test
Ensures CPR calculation stays within expected quantitative limits
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
cpr_mean_absolute_error
MAE against theoretical prepayment benchmark model • target: 0.5 • range: 0-5
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
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.
Reference links and supporting material
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
- Ensures CPR calculation stays within expected quantitative limits
- MAE against theoretical prepayment benchmark model • target: 0.5 • range: 0-5
- Benchmark: FinRisk-Stream-Bench
- Cpr Mean Absolute Error target: 0.5
- 1 public reference case
- JavaScript execution harness
- javascript sandbox (unavailable on Versalist)
View technical recipe
Configured tools
- Mastra AI · Required
- Hamming · Optional
- Arize Phoenix · Optional
- Arize Phoenix · Optional
- 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.