02.2 Kor.ai Bayesian Node Library - ravkorsurv/kor-ai-core GitHub Wiki

02.2 Kor.ai Bayesian Node Library (Market Abuse)

This page defines the canonical node library for constructing Bayesian Networks (BNs) across market abuse typologies such as insider dealing, spoofing, layering, wash trades, price manipulation, and front-running. It supersedes and consolidates elements from 11.2_Node_Library for unified usage.

Each node includes a definition, example states, data inputs, and typical parent/child relationships. This supports modular model design, CPT consistency, and auditability across Kor.ai.


๐Ÿ”‘ Core Latent Nodes (Inferred Concepts)

IntentToManipulate

  • Whether the actor is deliberately attempting to distort the market.
  • True, False, Uncertain
  • Parents: OrderAggressiveness, LayeringPattern, QuoteImbalance, PNLSpike
  • Children: MarketAbuseLikelihood

AccessToMNPI

  • Whether the actor had access to material non-public information (MNPI).
  • Yes, No
  • Parents: Role, HRSignals, EmailKeywords, AccessLogs
  • Children: IntentToTradeOnMNPI, MarketAbuseLikelihood

IntentToTradeOnMNPI

  • Whether actor acted on privileged info.
  • Yes, No, Unclear
  • Parents: AccessToMNPI, TradeDirectionAligned, TimingProximity
  • Children: MarketAbuseLikelihood

SpoofingDetected

  • Signal indicating spoofing pattern.
  • None, Suspected, Confirmed
  • Parents: OrderPlacementRate, CancelRateRatio, BookPressure
  • Children: IntentToManipulate, MarketAbuseLikelihood

WashTradeLikelihood

  • Likelihood of wash trade behavior.
  • Low, Medium, High
  • Parents: CounterpartyMatch, VolumeMirror, TimeWindowRepetition
  • Children: MarketAbuseLikelihood

ClusteredBehavior

  • Pattern similarity with prior cases.
  • None, Similar, HighlyCorrelated
  • Parents: TraderID, BehaviorVector
  • Children: MarketAbuseLikelihood

KnownRiskProfile

  • Prior alert history or case exposure.
  • Clean, PreviouslyFlagged, UnderInvestigation
  • Inputs: STORs, alerts
  • Children: MarketAbuseLikelihood

MarketAbuseLikelihood

  • Posterior abuse score node.
  • Low, Medium, High
  • Parents: all above
  • Children: AlertRaised, ExplainabilityModule

๐Ÿ” Evidence Nodes (Observable Inputs)

Trade Behavior

  • OrderAggressiveness โ€” Passive, Neutral, Aggressive
  • OrderPlacementRate โ€” Low, Medium, High
  • CancelRateRatio โ€” <50%, 50โ€“90%, >90%
  • BookPressure โ€” Neutral, BidPressure, AskPressure
  • LayeringPattern โ€” None, Moderate, Strong
  • TradeDirectionAligned โ€” Yes, No, Neutral
  • TimingProximity โ€” <1h, SameDay, >1d
  • TradeTimingWindow โ€” NormalHours, EndOfDay, EventDriven
  • VolumeSpike โ€” None, Moderate, High

Trade Outcome

  • PNLSpike โ€” Absent, Mild, Extreme
  • VolumeMirror โ€” No, Partial, Full
  • CounterpartyMatch โ€” No, Possible, Likely
  • TimeWindowRepetition โ€” Absent, Moderate, Frequent

Comms / Access / HR

  • EmailKeywords โ€” Clean, Flagged, Escalated
  • AccessLogs โ€” Yes, No, Unknown
  • ClientOrderVisibility โ€” None, Limited, Full
  • PreTradeBehavior โ€” Neutral, MinorFrontRun, SignificantFrontRun
  • HRSignals โ€” Low, Moderate, High

KYC / Profile Context

  • KYCRiskRating โ€” Low, Medium, High
  • TraderID โ€” categorical key for linking history
  • Role โ€” Analyst, Sales, Trader, DeskHead, etc.

๐Ÿงพ Output / UX Nodes

AlertRaised

  • Whether score crosses alert threshold.
  • True, False

ExplainabilityModule

  • Captures key drivers of posterior.
  • JSON structure includes:
    • node
    • value
    • score_impact
    • confidence
    • input_description
    • Optional tag

๐Ÿง  Integration Notes

  • This library replaces 11.2 with additional structure, clustering, and front-running support.
  • Each node has an alias (Q#) for compact model serialization.
  • Nodes are reusable across modular DAG templates in 13.2.
  • CPTs are stored and versioned separately.
  • Explainability logic is powered by this same set.

Next: Ensure CPT scaffolds and typology mappings reflect this unified structure. DAG generation services and Agena model uploads should use this version going forward.