Automated Crude Trade Counterparty Credit & Regulatory Risk Guard with Mastra AI
Participating trading firms under the interim mechanism must maintain active credit ratings and clean regulatory standing. Build an autonomous risk guard agent using Mastra AI. The agent uses Mastra AI workflows and memory to continuously monitor trading firm credit risk metrics, evaluate exposure limits against open nominations, and issue dynamic trading freeze alerts when thresholds are breached.
What you are building
The core problem, expected build, and operating context for this challenge.
Develop a credit risk monitoring and trading limit agent using Mastra AI TypeScript engine.
How work is evaluated
Evaluates credit exposure freeze triggers on counterparty credit downgrades.
Challenge datasets
Public datasets, plus the private datasets you have access to.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
trade_blocked
Ensure trade is blocked when total exposure exceeds limit.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
risk_calculation_accuracy
Accuracy of exposure total math. • target: 1 • range: 0-1
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
What you should walk away with
Implement credit rating verification tools in Mastra AI.
Build dynamic credit exposure calculation workflows.
Issue automated trade freeze triggers when risk limits are exceeded.
Reference links and supporting material
Counterparty credit profiles and active trade exposure databases.
Challenge setup
Evaluates credit exposure freeze triggers on counterparty credit downgrades.
Challenge input
JSON with credit_limit_usd, open_exposure_usd, pending_cargo_val_usd, credit_rating
Mastra AI
TypeScript agentic framework for stateful business rule enforcement.
Evaluated output
JSON with total_exposure_usd, trade_allowed, freeze_reason
- Ensure trade is blocked when total exposure exceeds limit.
- Accuracy of exposure total math. • target: 1 • range: 0-1
- Benchmark: Mastra-Risk-Bench
- Risk Calculation Accuracy target: 1
- 1 public reference case
- JavaScript execution harness
- javascript 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
- Mastra AI · Required
- TPOT · Optional
- All Hands AI · Optional
- Mastra AI · Required
Evaluation contract
- trade_blocked · Weight 1
- risk_calculation_accuracy · Weight 1
Metrics
- risk_calculation_accuracy · Target 1
Benchmarks
- Mastra-Risk-Bench
- general
Reference cases
- 1 public reference case
Workflow tasks
- Task 1
Input: JSON with credit_limit_usd, open_exposure_usd, pending_cargo_val_usd, credit_rating
Output: JSON with total_exposure_usd, trade_allowed, freeze_reason
Execution harness: JavaScript
Evaluation tools
- Mastra AI · Workflow Engine
Recipe freeze marker
No recipe freeze time is recorded.