Skip to main content
Challenge

Real-Time Clearing Ledger Anomaly Guard with Pydantic AI & Qwen 3

High-frequency institutional clearing engines require microsecond-level ledger anomaly detection to prevent systemic counterparty risk during market volatility. Build a type-safe clearing telemetry engine using Pydantic AI and Qwen 3 to detect ledger discrepancies, validate margin compliance, and achieve 99% accuracy on simulated trade settlement datasets.

CybersecurityHosted by Vera
Challenge brief

What you are building

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

Build a type-safe, validated clearing house anomaly detector using Pydantic AI and the Qwen 3 open model runtime.

Delivery guide

How work is evaluated

Evaluation

Evaluates trade settlement anomaly detection accuracy and Pydantic schema validation integrity.

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

pydantic_type_check

Ensures response object instantiates the target Pydantic class without validation error.

Binary check

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

Dimension 2

clearing_anomaly_accuracy

Accuracy in distinguishing valid clears from anomalous trades. • target: 0.99 • 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 Pydantic AI agents with strictly typed result validation models

  • Integrate Qwen 3 model for rapid trade payload inspection and risk scoring

  • Design real-time margin coverage checks for high-frequency institutional clears

  • Achieve 99% accuracy in identifying off-market trade prices and collateral mismatches

Resources and assets

Reference links and supporting material

Dataset notes

Synthetic dataset of 500 institutional trade settlement records containing execution prices, order sizes, and real-time market bid-ask feeds.

Challenge setup

Evaluates trade settlement anomaly detection accuracy and Pydantic schema validation integrity.

Challenge input

JSON containing trade execution details, counterparty credit limit, and current asset price

Pydantic AI

Type-safe Python framework enforcing structured schema outputs.

Qwen 3

High performance open model for fast structured output generation.

Evaluated output

Validated Pydantic model response with approval status, variance_percentage, and flags

Evaluation checks
  • Ensures response object instantiates the target Pydantic class without validation error.
  • Accuracy in distinguishing valid clears from anomalous trades. • target: 0.99 • range: 0-1
Configured evaluation evidence
  • Benchmark: ClearingGuard-Bench-v1
  • Clearing Anomaly Accuracy target: 0.99
  • 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
  • Pydantic AI · Required
  • Alibaba Cloud (Qwen) · Optional
Policy Serving
  • Qwen 3 · Optional
Orchestration
  • Pydantic AI · Required

Evaluation contract

  • pydantic_type_check · Weight 1
  • clearing_anomaly_accuracy · Weight 1

Metrics

  • clearing_anomaly_accuracy · Target 0.99

Benchmarks

  • ClearingGuard-Bench-v1
  • security

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON containing trade execution details, counterparty credit limit, and current asset price

    Output: Validated Pydantic model response with approval status, variance_percentage, and flags

    Execution harness: Python

Evaluation tools

  • Pydantic AI · Type-Safe Agent Framework
  • Qwen 3 · LLM Inference Engine

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Real-Time Clearing Ledger Anomaly Guard with Pydantic AI & Qwen 3