Skip to main content
Challenge

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.

Business OperationsHosted by Vera
Challenge brief

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.

Delivery guide

How work is evaluated

Evaluation

Evaluates credit exposure freeze triggers on counterparty credit downgrades.

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

trade_blocked

Ensure trade is blocked when total exposure exceeds limit.

Binary check

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

Dimension 2

risk_calculation_accuracy

Accuracy of exposure total math. • target: 1 • range: 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

  • Implement credit rating verification tools in Mastra AI.

  • Build dynamic credit exposure calculation workflows.

  • Issue automated trade freeze triggers when risk limits are exceeded.

Resources and assets

Reference links and supporting material

Dataset notes

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

Evaluation checks
  • Ensure trade is blocked when total exposure exceeds limit.
  • Accuracy of exposure total math. • target: 1 • range: 0-1
Configured evaluation evidence
  • Benchmark: Mastra-Risk-Bench
  • Risk Calculation Accuracy target: 1
  • 1 public reference case
Configured runtime
  • 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

Action Space
  • Mastra AI · Required
  • TPOT · Optional
  • All Hands AI · Optional
Orchestration
  • 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

  1. 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.

Frequently Asked Questions about Automated Crude Trade Counterparty Credit & Regulatory Risk Guard with Mastra AI