Skip to content

CrediQS

Financial risk intelligence platform.

Graph-native · Memory-native · Regulator-ready

Unified risk intelligence across TradFi and DeFi.


TradFi derivatives and DeFi positions share the same probability-of-default curve, the same CVA engine, and the same regulator-citable explanation.

Every number is traceable. Every decision is explainable. Every assessment makes the next one smarter.

Repositories

Risk engines

Repository Description Tests Status
pyccr Counterparty credit risk engine. CVA/DVA/FVA/KVA via Hull-White Monte Carlo, SA-CCR EAD, VaR/ES, OIS curve bootstrapping, CDS curve, sensitivity analysis. 487 ● Active
pyccr.vol Volatility surface module. BSM, Black-76, SABR (Hagan 2002), Heston (1993), neural network calibration, Greeks (1st + 2nd order), FRTB SBA vega + curvature + DRC + RRAO. 144 ◐ Building
pyccr.climate Climate risk overlay. Physical risk (BIS 1274 Φ_q,α), transition risk (Le Guenedal/Tankov/Sopgoui), NGFS v5 scenarios, OSFI SCSE logit PD add-ons. Horizontal — applies to all engines. 76 ● Active
pycredit IFRS 9 expected credit loss engine. PD/LGD/EAD, WOE logistic scorecard, XGBoost PD (TreeSHAP), SICR detection, vintage analysis, forward-looking 3-scenario weighting. 225 ● Active
pychain DeFi risk engine. Liquidation bootstrap PD, smart contract scoring, stablecoin/MiCA, governance HHI, oracle risk, bridge risk, issuer risk, GNN contagion, real-time monitor. 367 ● Active

Platform infrastructure

Repository Description Tests Status
crediqs-core Shared contracts and infrastructure. Unified PDCurve, CreditRating, TransitionMatrix, CalibrationRegistry (73 parameters), RiskEngineResult protocol, zero-fallback enforcement. 29 ● Active
crediqs-data Data ingestion and graph layer. TradFi plane (FRED, ECB, CME), on-chain plane (DefiLlama, Dune, The Graph), carbon plane (Toucan, Verra), vol quotes. GraphStore (NetworkX + DeXposure-FM 4,300 edges). CalibrationRegistry store. 205 ● Active
crediqs-explain Explainability and model governance. 5 layers: data lineage, feature attribution (SHAP/analytic/transparent), decision trace, counterfactual, fairness testing. 9 registered adapters. 4 explainability classes. 195 ● Active
crediqs-lab Scenario engine and model validation. Regulatory stress (EBA 2025, CCAR), historical replay (GFC, COVID, crypto winter), sensitivity sweep, backtest (55 events, traffic light, Kupiec, Christoffersen), reverse stress, ICAAP capital aggregation. 170 ◐ Extending
crediqs-catalogue YAML-driven node catalogue. Input/output schemas with source declarations, governance metadata, regulatory citations. Database-seeded. Zero hardcoded definitions. ● Active

Application layer

Repository Description Tests Status
crediqs-api FastAPI REST API. Risk engine orchestrator,routers , vol surface endpoints, MiCA compliance, stress/sensitivity, portfolio management. Live on Railway. ● Active
agent-service AI agentic intelligence layer. LangGraph 6-node graph: classify → plan → execute → assess → synthesize → persist. Memory Layer (6 layers), graph enrichment, explain integration, data-driven node discovery. ● Active
platform-backend FastAPI backend. Projects, environments, Portfolio & Trade Lifecycle, workflows, cases, Decision Engine (22 rules), model governance lifecycle (draft → validated → production), memory authority, WebSocket streaming. ● Active
platform-frontend Next.js 15 / React 19 / TypeScript. R3 architecture: DashboardLoader, WIDGETS registry, node-driven rendering, Settings → Models, AI Workspace copilot, Scenarios tab (stress/sensitivity/validation/library). ● Active

Technical foundation

Unified PDCurve

The single most important architectural decision. Three PD sources — CDS bootstrap (market-implied), WOE/XGBoost scorecard (statistical/ML), and on-chain liquidation bootstrap (DeFi) — produce the same PDCurve object that feeds the same CVA engine and the same ECL computation.

# Same interface, three sources
pd_curve = CDSCurve.from_spread(85, lgd=0.45)              # TradFi: market-implied
pd_curve = WOEScorecard.predict(features).to_pd_curve()      # Credit: statistical
pd_curve = LiquidationBootstrap.fit(snapshot).pd_curve        # DeFi: on-chain
# All three feed:
cva = compute_cva(exposure_profile, pd_curve, ois_curve)     # same CVA engine
ecl = compute_ecl(ead, pd_curve, lgd, stage)                  # same ECL engine

Portfolio & Trade Lifecycle

First-class Portfolio entity: structured collection of trades flowing through all 18 layers. TradeDefinition captures the full instrument structure — product type, economic terms, counterparty, CSA, DeFi terms. NettingSet groups trades for CVA/SA-CCR. Ingestion pipeline: upload → parse → validate → normalise → enrich → store → construct. Product types are CalibrationRegistry strings — new instruments without code change.

portfolio = Portfolio(trades=[
    TradeDefinition(trade_id="T1", product_type="ir_swap", notional=10_000_000, ...),
    TradeDefinition(trade_id="T2", product_type="swaption", notional=5_000_000, ...),
    TradeDefinition(trade_id="T3", product_type="defi_lending", protocol="aave_v3", ...),
])
# Same portfolio feeds: pricing → Greeks → CVA → ECL → stress → FRTB → ICAAP → reporting

Graph-native intelligence

The graph is not a visualization — it is the primary data structure the system reasons from. Every assessment enriches a graph node. Every dependency is a weighted edge. DebtRank propagates distress. The agent reads graph neighbours during classification, not after.

Layer 1 (built):    Foundation — 6 memory layers, GraphStore, DeXposure-FM, 7 Docker services
Layer 2 (active):   Continuous learning — every assessment enriches memory + graph + patterns
Layer 3 (emerging): Graph RAG — traverse edges, compute via weights, answer with systemic context
Layer 4 (emerging): Autonomous agents — Graph Agent, Risk Agent, Compliance Agent, Alert Agent
  • GraphStore — NetworkX DiGraph. Node = entity. Edge = financial relationship.
  • DeXposure-FM — 4,300 protocol dependency edges across 602 chains.
  • GNN Contagion — GAT attention mechanism. Contagion multiplier per entity.
  • DebtRank — iterative distress propagation for systemic importance.
  • Anomaly detection — ECL spike, rating drift, pattern deviation, neighbour contagion, sector outlier.

Memory-native

Memory is not conversation history replayed into a prompt. Memory is structured, searchable, and accumulative. The classify node reads entity memory, graph neighbours, similar cases, and org patterns before the LLM is called.

Layer What it stores Where it lives
Turn memory Last 3 conversation turns AgentState
Session memory Full session state, survives restarts PostgreSQL checkpointer
Entity memory Last rating, ECL, action, risk summary per entity memory_entities table
Semantic search 384-dim embeddings, cosine similarity pgvector
Org patterns Accumulated decision patterns per org memory_patterns table
Sector patterns Cross-org aggregation (privacy-preserving) memory_interactions table

AI agentic copilot

The Workspace tab is not a chatbot — it is a risk intelligence copilot that answers from computed data, not from training knowledge. When a user asks "what is my DV01?", the copilot reads the portfolio, calls the Greeks engine, runs attribution through crediqs-explain, and responds with the user's actual numbers.

Question arrives
  → classify reads entity_memory (structured, not replayed)
  → classify reads graph_node (neighbours, weights, DebtRank)
  → classify reads similar_cases (semantic vector search)
  → classify reads org_patterns (accumulated decision history)
  → LLM classifies WITH all of this as structured context
  
Assessment completes
  → persist writes to memory_entities (entity knowledge grows)
  → persist writes to graph node (graph knowledge grows)
  → persist writes embedding (semantic search improves)
  → next question about same entity is richer than the last

The agent discovers capabilities from the node catalogue — no hardcoded routing. Adding a new engine = inserting a catalogue node. The agent finds it on the next query.

Scenario engine

Full stress testing lifecycle: regulatory scenarios (EBA 2025, Fed CCAR, PRA, OSFI), historical replay (GFC, COVID, crypto winter, USDC depeg), sensitivity analysis (single-factor, multi-factor, KRD, 2D surface), model validation (traffic light backtest, Kupiec, Christoffersen, PSI drift), reverse stress testing, FRTB capital under stress (SBM + DRC + RRAO), ICAAP aggregation (Pillar 1 + 2A + 2B), and climate stress (NGFS v5).

Zero-fallback principle

Every number shown on the platform must be traceable to a successful real-time market data pull, tool result, model output, database record, or user input. No hardcoded numeric fallbacks. No fabricated pd_1y: 0.02 in seed data. No entity: "SAMPLE". If a required value is missing, the module raises ValueError — it does not silently produce a number.

Explainability (risk engine adapters)

Every engine output has a registered explain adapter. Every number carries its attribution.

Data-driven architecture (R3)

Zero hardcoded profiles, templates, or dashboard mappings. Everything from the database:

  • Node Catalogue — 32+ nodes in catalogue_nodes table. Each declares requires[], produces[], input_schema, output_schema, governance fields.
  • DashboardLoader — reads workflow nodes → matches produces[] to WIDGETS registry → lazy-loads the right dashboard. No if (type === "tradfi").
  • Model Registry — Settings → Models with governance lifecycle: draft → validated → production → deprecated. Test Contract validation before promotion.
  • Agent Discovery — classify.py fetches effective-nodes from API. collect.py carries explain_adapter from catalogue. No hardcoded routing in agent-service.

Regulatory coverage

Regulation What crediqs covers Engine
Basel IV CRR3 CVA, SA-CCR, IRB capital, FRTB SBA pyccr
IFRS 9 ECL staging (1/2/3), SICR detection, 3-scenario weighting pycredit
MiCA EMT/ART classification, CASP readiness, stablecoin monitoring pychain
EU AI Act Art. 13 Explainability for high-risk AI (credit scoring) crediqs-explain
SR 11-7 Model documentation, validation, backtest, drift monitoring crediqs-lab
EBA Pillar 3 ESG Physical + transition risk overlay pyccr.climate
FRTB MAR 21.8 Vega + curvature risk charges pyccr.vol
DORA ICT third-party risk (planned)
EMIR REFIT Trade reporting (planned)

Research foundations

Every model cites its academic source. Every regulatory computation cites the specific article.

Technology stack

Layer Technology
Risk engines Python 3.12, NumPy, SciPy, XGBoost, PyTorch (neural calibration)
Graph NetworkX, PyTorch Geometric (GNN), DeXposure-FM
API FastAPI, SQLAlchemy async, Alembic
Agent LangGraph, sentence-transformers, pgvector
Database PostgreSQL 16 + pgvector extension
Frontend Next.js 15, React 19, TypeScript, Tailwind, ReactFlow, Zustand
Infrastructure Docker, Redis, Railway (API), Render (backend), Vercel (frontend)

Contact

Website · Contact

Graph-native risk intelligence. Every assessment makes the next one smarter.

Popular repositories Loading

  1. .github .github Public

Repositories

Showing 1 of 1 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…