The Backend of LuckTrainingRoadmaps

Anti-Fraud Scoring Pipeline (Chapter 19)

Anti-Fraud Scoring Pipeline (Chapter 19) A data-flow diagram generated by Archify. 01 / Ingest 02 / Transit 03 / Features + Models 04 / Decision 05 / Analysts + Feedback Casino API · bet / deposit / withdrawal · 01 / Ingest · AcmeToCasino Casino API bet / deposit / withdrawal AcmeToCasino Wallet Events · PostgreSQL ledger · 01 / Ingest · system of record Wallet Events PostgreSQL ledger system of record Fraud Event Pusher · cron 60s, mTLS HTTPS POST · 02 / Transit · ops boundary, ≤1000 rows Fraud Event Pusher cron 60s, mTLS HTTPS POST ops boundary, ≤1000 rows Fraud API · ingest + 3 rules, risk score · 02 / Transit Fraud API ingest + 3 rules, risk score Event Stream · Elasticsearch + Kafka bridge · 02 / Transit · fraud.raw.events; validate to dedup Event Stream Elasticsearch + Kafka bridge fraud.raw.events; validate to dedup Dead-letter Queue · schema and dedup failures · 02 / Transit Dead-letter Queue schema and dedup failures Feature Pipeline · Polars feature engineering · 03 / Features + Models · windows: 5m / 24h / 30d Feature Pipeline Polars feature engineering windows: 5m / 24h / 30d Feature Store · Redis + Iceberg · 03 / Features + Models · sub-ms online reads Feature Store Redis + Iceberg sub-ms online reads ML Ensemble · weighted vote, sub-10ms · 03 / Features + Models · 6-model ensemble ML Ensemble weighted vote, sub-10ms 6-model ensemble Decision Engine · risk bands to action · 04 / Decision · block / case / monitor / log Decision Engine risk bands to action block / case / monitor / log Fraud Cases Store · Postgres, append-only · 05 / Analysts + Feedback · hashed link edges Fraud Cases Store Postgres, append-only hashed link edges Fraud Workbench v3 · analyst UI, SSE + JWT · 05 / Analysts + Feedback Fraud Workbench v3 analyst UI, SSE + JWT bet/deposit/withdrawal events ledger write cron read batch ≤ 1000 rows HTTPS POST (mTLS) crosses ops boundary scored events indexed + streamed validated stream post dedup engineered features windowed feature vectors online read risk score sub-10ms logged actions append-only case queue analyst view schema/dedup failures dead letter labeled Clear/Block → retrain feedback loop Legend primary data policy / PII async batch data store data flow

Scale & Latency

  • • Target 100K tx/s, sub-50ms scoring
  • • Measured p95 API latency of 83 ms
  • • 158K+ events indexed, 1.9K+ alerts

Ensemble & Decision

  • • Six models vote: XGBoost, LSTM, IForest, RF, GraphNN, AE
  • • Decision bands run auto-block (>0.9) to log-only (<0.5)
  • • Ensemble weights adapt over time

Failure Isolation

  • • Schema checks + dedup isolate poison events
  • • Analyst Clear/Block becomes training data
  • • Level 1 cron survives Kafka/lakehouse outage