8.9 KiB
8.9 KiB
AML Screening Flow
Overview
The AML/CTF screening system performs comprehensive transaction monitoring, sanctions checking, PEP (Politically Exposed Person) detection, and pattern analysis to identify potential money laundering or terrorist financing activities. This flow documents the complete screening and risk scoring process.
Prerequisites
- Transaction exists with entity information
- AML service operational
- Sanctions lists available
- PEP database accessible
- RegTech supervision engine available
Visual Flow Diagram
┌─────────────┐
│ Transaction │
│ Request │
└──────┬──────┘
│
│ 1. Sanctions Check
▼
┌─────────────────────────┐
│ Check Sanctions List │
│ - Entity name lookup │
│ - OFAC, EU, UN lists │
│ - Risk: +100 if match │
└──────┬──────────────────┘
│
│ 2. PEP Check
▼
┌─────────────────────────┐
│ Check PEP List │
│ - Entity name lookup │
│ - PEP database │
│ - Risk: +50 if match │
└──────┬──────────────────┘
│
│ 3. Pattern Detection
▼
┌─────────────────────────┐
│ Detect Anomalous │
│ Patterns │
│ - Velocity analysis │
│ - Circular transfers │
│ - Risk score │
└──────┬──────────────────┘
│
│ 4. AML Behavior Monitoring
▼
┌─────────────────────────┐
│ RegTech AML Behavior │
│ Monitoring │
│ - Rule evaluation │
│ - Critical behaviors │
│ - Risk: +50 per critical│
└──────┬──────────────────┘
│
│ 5. Calculate Risk Score
▼
┌─────────────────────────┐
│ Determine Status │
│ - CLEAR: < 50 │
│ - FLAGGED: 50-99 │
│ - BLOCKED: >= 100 │
└──────┬──────────────────┘
│
│ 6. Create Record
▼
┌─────────────┐
│ Compliance │
│ Record │
└─────────────┘
Step-by-Step Process
Step 1: Sanctions Screening
- Receive screening request with:
- Sovereign bank ID
- Transaction ID
- Entity name (optional)
- Entity type (optional)
- Initialize risk score:
0 - Initialize screening results object
- If entity name provided:
- Check sanctions lists:
- OFAC (Office of Foreign Assets Control)
- EU sanctions list
- UN sanctions list
- Query sanctions database
- If match found:
- Set
sanctionsMatch: truein results - Add risk score:
+100(critical match)
- Set
- Check sanctions lists:
- Store sanctions check result
Code Reference: src/core/compliance/aml.service.ts:19-82
Step 2: PEP Screening
- If entity name provided:
- Check PEP (Politically Exposed Person) database
- Query PEP list by entity name
- If match found:
- Set
pepMatch: truein results - Add risk score:
+50(high risk)
- Set
- Store PEP check result
Code Reference: src/core/compliance/aml.service.ts:37-44
Step 3: Pattern Detection
- Analyze transaction for anomalous patterns:
- Transaction velocity (frequency)
- Amount patterns
- Geographic patterns
- Time-based patterns
- Detect specific patterns:
- Circular transfers (money going in circles)
- Synthetic layering (complex transaction chains)
- Structuring (breaking large amounts into smaller)
- Rapid movement (velocity anomalies)
- Calculate pattern risk score:
- Each pattern adds to risk score
- Pattern severity determines weight
- Store pattern risk in results
Code Reference: src/core/compliance/aml.service.ts:46-49
Step 4: AML Behavior Monitoring
- Call RegTech supervision engine:
- Pass transaction ID
- Pass sovereign bank ID
- Request AML behavior monitoring
- Supervision engine evaluates AML rules:
- Retrieves active AML behavior rules
- Evaluates each rule against transaction
- Returns triggered behaviors
- Process behavior results:
- Filter critical behaviors (severity:
critical) - For each critical behavior:
- Add risk score:
+50
- Add risk score:
- Store all behaviors in results
- Filter critical behaviors (severity:
- Store AML behavior results
Code Reference:
src/core/compliance/aml.service.ts:51-57src/core/compliance/regtech/supervision-engine.service.ts:22-50
Step 5: Risk Score Calculation
- Sum all risk components:
- Sanctions match:
+100(if match) - PEP match:
+50(if match) - Pattern risk: variable
- Critical AML behaviors:
+50each
- Sanctions match:
- Total risk score = sum of all components
Step 6: Status Determination
- Determine compliance status based on risk score:
- CLEAR: Risk score < 50
- FLAGGED: Risk score >= 50 and < 100
- BLOCKED: Risk score >= 100
- Status thresholds:
AML_RISK_CRITICAL: 100AML_RISK_HIGH: 50
Code Reference: src/core/compliance/aml.service.ts:59-65
Step 7: Create Compliance Record
- Create compliance record in database:
- Sovereign bank ID
- Transaction ID
- Record type:
AML_CHECK - Entity name (if provided)
- Entity type (if provided)
- Risk score
- Status (CLEAR, FLAGGED, or BLOCKED)
- Screening result (all check results)
- Timestamp
- Return compliance record
Code Reference: src/core/compliance/aml.service.ts:67-82
Error Handling
Error: Transaction Not Found
- Detection: Transaction ID doesn't exist
- Action: Continue screening with available data
- Recovery: Verify transaction ID
Error: Sanctions Database Unavailable
- Detection: Cannot query sanctions list
- Action: Log warning, continue with other checks
- Recovery: Retry sanctions check, use cached data
Error: RegTech Engine Unavailable
- Detection: Supervision engine returns error
- Action: Log warning, continue without AML behavior check
- Recovery: Retry AML behavior monitoring
Error: Pattern Detection Failure
- Detection: Pattern analysis throws error
- Action: Set pattern risk to 0, continue
- Recovery: Investigate pattern detection service
Integration Points
Related Services
- AML Service:
src/core/compliance/aml.service.ts - Supervision Engine:
src/core/compliance/regtech/supervision-engine.service.ts - Sanctions Database: External sanctions lists (OFAC, EU, UN)
- PEP Database: External PEP database
API Endpoints
POST /api/v1/compliance/aml/screen- Screen transactionGET /api/v1/compliance/aml/:recordId- Get screening recordGET /api/v1/compliance/aml/transactions/:transactionId- Get transaction screening
Database Models
ComplianceRecord- Compliance screening recordsSanctionsList- Sanctions list entriesSupervisionRule- AML behavior rules
Performance Metrics
- Sanctions Check: < 50ms target
- PEP Check: < 50ms target
- Pattern Detection: < 100ms target
- AML Behavior Monitoring: < 200ms target
- Total End-to-End: < 400ms target
- Throughput: 10,000+ screenings/second
- Availability: 99.99% uptime target
Security Considerations
Data Privacy
- Entity information handled securely
- Screening results encrypted
- Access restricted to authorized personnel
Real-Time Screening
- Screening performed before transaction execution
- Blocked transactions prevented from processing
- Flagged transactions require review
Audit Trail
- All screening results logged
- Risk scores recorded
- Status changes tracked
Testing Scenarios
Happy Path - CLEAR
- Valid transaction
- No sanctions match
- No PEP match
- No anomalous patterns
- No critical AML behaviors
- Risk score < 50
- Status: CLEAR
Happy Path - FLAGGED
- Valid transaction
- PEP match found
- Risk score >= 50 and < 100
- Status: FLAGGED
- Requires review
Happy Path - BLOCKED
- Valid transaction
- Sanctions match found
- Risk score >= 100
- Status: BLOCKED
- Transaction prevented
Error Scenarios
- Transaction not found
- Sanctions database unavailable
- RegTech engine unavailable
- Pattern detection failure
Edge Cases
- Multiple sanctions matches
- Both PEP and sanctions match
- Multiple critical AML behaviors
- High pattern risk score
- Concurrent screenings for same transaction
Related Flows: