SECTION 1: LEARNING OBJECTIVES

By the end of this lesson, you will be able to:

  • Define Anti-Money Laundering (AML) and Counter-Terrorist Financing (CFT) in the context of digital assets.

  • Explain the FATF Recommendations for Virtual Asset Service Providers (VASPs).

  • Understand the Travel Rule and its implementation requirements.

  • Describe KYC processes and customer due diligence for crypto businesses.

  • Differentiate between transaction monitoring, sanctions screening, and reporting obligations.

  • Identify red flags and suspicious activity indicators.

  • Implement a basic AML compliance simulation in Python.

  • Develop a framework for building an AML compliance program.


SECTION 2: AML/CFT FUNDAMENTALS

2.1 What is AML/CFT?

Anti-Money Laundering (AML) refers to the laws, regulations, and procedures designed to prevent criminals from disguising illegally obtained funds as legitimate income. Counter-Terrorist Financing (CFT) focuses on preventing the flow of funds to terrorist organisations.

In the context of digital assets, AML/CFT is critical because:

 
 
Reason Description
Pseudonymity Blockchain transactions are pseudonymous, making identification challenging.
Cross-Border Digital assets move across borders instantly, complicating jurisdictional oversight.
Speed Transactions settle in seconds or minutes, faster than traditional banking.
Scale Growing adoption increases the potential for misuse.
Innovation New products (DeFi, NFTs, stablecoins) create new compliance challenges.

2.2 The Three Lines of Defence

text
┌─────────────────────────────────────────────────────────────────────────────┐
│                    AML/CFT THREE LINES OF DEFENCE                           │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  1ST LINE: BUSINESS OPERATIONS                                              │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │ • Customer onboarding and KYC                                      │   │
│  │ • Transaction monitoring                                            │   │
│  │ • Customer due diligence (CDD)                                      │   │
│  │ • Enhanced due diligence (EDD) for high-risk customers             │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                    │                                        │
│                                    v                                        │
│  2ND LINE: COMPLIANCE & RISK MANAGEMENT                                    │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │ • AML policy and procedures                                         │   │
│  │ • Risk assessment                                                   │   │
│  │ • Training and awareness                                           │   │
│  │ • Compliance monitoring                                             │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                    │                                        │
│                                    v                                        │
│  3RD LINE: INTERNAL AUDIT                                                  │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │ • Independent review of AML program                                 │   │
│  │ • Testing of controls                                               │   │
│  │ • Reporting to board/management                                    │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

SECTION 3: FATF RECOMMENDATIONS

3.1 Key Recommendations for VASPs

The Financial Action Task Force (FATF) issued specific recommendations for Virtual Asset Service Providers:

Recommendation 15 (Revised):

 
 
Requirement Description
AML/CFT Obligations VASPs must comply with AML/CFT requirements.
Licensing/Registration VASPs must be licensed or registered.
Supervision VASPs must be supervised by competent authorities.
Sanctions VASPs must comply with targeted financial sanctions.
International Cooperation VASPs must cooperate with other jurisdictions.

Recommendation 16 (Travel Rule):

 
 
Requirement Description
Originator Information Name, account number, address/identity number.
Beneficiary Information Name, account number.
Threshold Applies to transactions above a specified threshold (varies by jurisdiction).
Data Sharing Secure transmission of information.
Record Keeping Maintain records for 5+ years.

3.2 Risk-Based Approach

The FATF advocates for a risk-based approach:

text
┌─────────────────────────────────────────────────────────────────────────────┐
│                    RISK-BASED APPROACH                                      │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  1. IDENTIFY RISKS                                                         │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │ • Geographic risk (high-risk jurisdictions)                          │   │
│  │ • Customer risk (PEPs, high-risk profiles)                          │   │
│  │ • Product risk (high-risk products/services)                         │   │
│  │ • Delivery channel risk (online, anonymous)                          │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                    │                                        │
│                                    v                                        │
│  2. ASSESS AND PRIORITISE                                                  │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │ • Likelihood of money laundering/terrorist financing                │   │
│  │ • Impact of potential misuse                                        │   │
│  │ • Prioritise highest risks                                          │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                    │                                        │
│                                    v                                        │
│  3. MITIGATE RISKS                                                         │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │ • Implement controls proportionate to risk                        │   │
│  │ • Enhanced due diligence for high risk                              │   │
│  │ • Simplified due diligence for low risk                             │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

SECTION 4: KYC AND CUSTOMER DUE DILIGENCE

4.1 KYC Process

 
 
Stage Description Requirements
Identification Collect customer information Name, date of birth, address, ID document
Verification Verify customer identity Validate ID documents, check against databases
Screening Screen against watchlists Sanctions lists, PEP lists, adverse media
Risk Assessment Assess customer risk profile Risk rating, enhanced due diligence
Ongoing Monitoring Monitor customer activity Transaction monitoring, periodic review

4.2 Enhanced Due Diligence (EDD)

EDD is required for high-risk customers:

 
 
Indicator Example
PEP Status Politically Exposed Persons
High-Risk Jurisdictions Customers from sanctioned countries
Unusual Activity Large, frequent, or unusual transactions
Complex Ownership Complex corporate structures

EDD Requirements:

  • Additional identity verification (utility bills, employer confirmation)

  • Source of funds and source of wealth verification

  • Enhanced transaction monitoring

  • Senior management approval for onboarding

4.3 KYC Challenges in Crypto

 
 
Challenge Description Mitigation
Pseudonymity Wallet addresses are pseudonymous Link addresses to identity
Non-Custodial Users may not use custodial services DeFi compliance
Global Nature Cross-border customer base Multi-jurisdictional compliance
Wallet Reuse Users may have multiple wallets Address clustering
Privacy Coins Enhanced anonymity Enhanced monitoring

SECTION 5: TRANSACTION MONITORING

5.1 Key Monitoring Activities

 
 
Activity Description Indicators
Real-Time Monitoring Flag suspicious transactions Large amounts, unusual patterns
Historical Analysis Review historical activity Abnormal trends
On-Chain Analysis Trace blockchain transactions Links to illicit activity
Address Screening Check addresses against watchlists Sanctioned addresses
Volume Analysis Monitor transaction volumes Unusual spikes

5.2 Red Flags

 
 
Category Red Flags
Transaction Patterns Frequent large transactions, structuring, rapid movement
Geographic Transactions to/from high-risk jurisdictions
Wallet Behaviour Newly created wallets receiving large amounts
DeFi Activity Unusual yield farming, flash loans, privacy pools
Behavioural Inconsistent activity, unusual trading patterns

5.3 Reporting Obligations

 
 
Report Type Description Timing
Suspicious Activity Report (SAR) Report suspicious transactions Within specified timeframes
Travel Rule Reports Share transaction information Pre-transaction or post-transaction
Threshold Reports Report large transactions 24 hours (varies)
Annual Reports Regulatory reporting Annual cycle

SECTION 6: IMPLEMENTATION IN PYTHON

python
# ===================================================================
# MODULE 5, LESSON 3: AML/CFT AND COMPLIANCE
# ===================================================================

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from typing import Dict, List, Tuple
import random
import hashlib
import warnings
warnings.filterwarnings('ignore')

print("="*70)
print("AML/CFT AND COMPLIANCE")
print("="*70)

# ----------------------------------------------------------------
# PART A: RISK ASSESSMENT SIMULATION
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART A: Customer Risk Assessment")
print("-"*60)

class CustomerRiskAssessment:
    """
    Simulated AML risk assessment for customers.
    """
    def __init__(self):
        self.risk_factors = {
            'jurisdiction_risk': {'High': 3, 'Medium': 2, 'Low': 1},
            'transaction_volume': {'High': 3, 'Medium': 2, 'Low': 1},
            'transaction_frequency': {'High': 3, 'Medium': 2, 'Low': 1},
            'pep_status': {'Yes': 3, 'No': 1},
            'source_of_funds': {'Verified': 1, 'Unverified': 3},
            'unusual_activity': {'Yes': 3, 'No': 1}
        }
    
    def assess(self, customer_data: Dict) -> Dict:
        """Assess customer risk based on multiple factors."""
        score = 0
        max_score = 0
        details = {}
        
        for factor, value in customer_data.items():
            if factor in self.risk_factors:
                factor_score = self.risk_factors[factor].get(value, 1)
                score += factor_score
                max_score += 3
                details[factor] = factor_score
        
        risk_percentage = score / max_score if max_score > 0 else 0
        risk_level = self._get_risk_level(risk_percentage)
        
        return {
            'risk_score': score,
            'risk_percentage': risk_percentage,
            'risk_level': risk_level,
            'details': details
        }
    
    def _get_risk_level(self, percentage: float) -> str:
        if percentage > 0.7:
            return 'High'
        elif percentage > 0.4:
            return 'Medium'
        else:
            return 'Low'

# Simulate risk assessments
assessor = CustomerRiskAssessment()

customers = [
    {'jurisdiction_risk': 'Low', 'transaction_volume': 'Low', 'transaction_frequency': 'Low',
     'pep_status': 'No', 'source_of_funds': 'Verified', 'unusual_activity': 'No'},
    {'jurisdiction_risk': 'High', 'transaction_volume': 'High', 'transaction_frequency': 'High',
     'pep_status': 'Yes', 'source_of_funds': 'Unverified', 'unusual_activity': 'No'},
    {'jurisdiction_risk': 'Medium', 'transaction_volume': 'High', 'transaction_frequency': 'Medium',
     'pep_status': 'No', 'source_of_funds': 'Unverified', 'unusual_activity': 'Yes'}
]

print("Customer Risk Assessments:")
for i, customer in enumerate(customers):
    result = assessor.assess(customer)
    print(f"\nCustomer {i+1}: Risk Level = {result['risk_level']}")
    print(f"  Score: {result['risk_score']} ({result['risk_percentage']:.0%})")
    print("  Factors:")
    for factor, score in result['details'].items():
        print(f"    {factor}: {score}/3")

# ----------------------------------------------------------------
# PART B: TRANSACTION MONITORING
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART B: Transaction Monitoring Simulation")
print("-"*60)

class TransactionMonitor:
    """
    Simulated transaction monitoring for suspicious activity.
    """
    def __init__(self):
        self.transactions = []
        self.suspicious_transactions = []
        self.thresholds = {
            'large_amount': 50000,
            'high_frequency': 10,  # per day
            'unusual_destination': 'HighRisk',
            'structuring': 10000  # Below reporting threshold
        }
    
    def add_transaction(self, customer_id: str, amount: float, 
                        destination: str, timestamp: str) -> Dict:
        """Add a transaction and check for suspicious activity."""
        tx = {
            'customer_id': customer_id,
            'amount': amount,
            'destination': destination,
            'timestamp': timestamp,
            'tx_hash': hashlib.sha256(f"{customer_id}{amount}{timestamp}".encode()).hexdigest()[:16]
        }
        self.transactions.append(tx)
        
        # Check for suspicious activity
        flags = self._check_suspicious(tx)
        if flags:
            tx['flags'] = flags
            self.suspicious_transactions.append(tx)
        
        return tx
    
    def _check_suspicious(self, tx: Dict) -> List[str]:
        """Check for suspicious activity indicators."""
        flags = []
        
        # Large transaction
        if tx['amount'] > self.thresholds['large_amount']:
            flags.append('Large Amount')
        
        # Unusual destination
        if tx['destination'] == self.thresholds['unusual_destination']:
            flags.append('Unusual Destination')
        
        # Structuring (multiple small transactions)
        recent_txs = [t for t in self.transactions 
                     if t['customer_id'] == tx['customer_id'] and 
                     t['amount'] < self.thresholds['structuring']]
        if len(recent_txs) > self.thresholds['high_frequency']:
            flags.append('High Frequency (Potential Structuring)')
        
        # Round amounts (often associated with illicit activity)
        if tx['amount'] % 1000 == 0 and tx['amount'] > 10000:
            flags.append('Round Amount')
        
        return flags
    
    def get_suspicious_report(self) -> pd.DataFrame:
        """Generate suspicious activity report."""
        if not self.suspicious_transactions:
            return pd.DataFrame()
        
        data = []
        for tx in self.suspicious_transactions:
            data.append({
                'Customer': tx['customer_id'],
                'Amount': tx['amount'],
                'Destination': tx['destination'],
                'Flags': ', '.join(tx['flags']),
                'TX Hash': tx['tx_hash'][:8] + '...'
            })
        return pd.DataFrame(data)

# Simulate transactions
monitor = TransactionMonitor()

print("Simulating transaction monitoring...")
customers = ['C001', 'C002', 'C003']
destinations = ['Normal', 'HighRisk', 'Normal', 'Normal', 'HighRisk']

# Generate transactions
for i in range(50):
    customer = random.choice(customers)
    amount = random.uniform(100, 75000)
    destination = random.choice(destinations)
    timestamp = f"2024-01-{random.randint(1, 15):02d} {random.randint(0, 23):02d}:{random.randint(0, 59):02d}"
    
    tx = monitor.add_transaction(customer, amount, destination, timestamp)
    
    # Print suspicious transactions
    if 'flags' in tx:
        print(f"\n⚠️ Suspicious Transaction Detected:")
        print(f"  Customer: {customer}")
        print(f"  Amount: ${amount:,.2f}")
        print(f"  Flags: {', '.join(tx['flags'])}")

# Generate suspicious activity report
print(f"\nSuspicious Activity Report:")
suspicious_df = monitor.get_suspicious_report()
if not suspicious_df.empty:
    print(suspicious_df.to_string(index=False))
else:
    print("  No suspicious transactions detected")

# ----------------------------------------------------------------
# PART C: TRAVEL RULE COMPLIANCE
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART C: Travel Rule Compliance")
print("-"*60)

class TravelRule:
    """
    Simulated Travel Rule compliance for VASPs.
    """
    def __init__(self):
        self.records = []
        self.threshold = 3000  # USD/EUR equivalent
    
    def process_transaction(self, originator: Dict, beneficiary: Dict, amount: float) -> Dict:
        """Process a transaction with Travel Rule compliance."""
        transaction = {
            'transaction_id': hashlib.sha256(f"{originator['name']}{beneficiary['name']}{amount}".encode()).hexdigest()[:16],
            'originator': originator,
            'beneficiary': beneficiary,
            'amount': amount,
            'travel_rule_applicable': amount >= self.threshold,
            'compliance_status': 'Pending'
        }
        
        if transaction['travel_rule_applicable']:
            # Verify information completeness
            missing_info = []
            for field in ['name', 'account', 'address']:
                if not originator.get(field):
                    missing_info.append(f"originator.{field}")
                if not beneficiary.get(field):
                    missing_info.append(f"beneficiary.{field}")
            
            if missing_info:
                transaction['compliance_status'] = 'Incomplete'
                transaction['missing_info'] = missing_info
                print(f"⚠️ Travel Rule Info Incomplete: {', '.join(missing_info)}")
            else:
                transaction['compliance_status'] = 'Compliant'
                print(f"✅ Travel Rule Compliant")
        else:
            print(f"ℹ️ Below threshold - Travel Rule not applicable")
        
        self.records.append(transaction)
        return transaction
    
    def get_compliance_report(self) -> pd.DataFrame:
        """Generate compliance report."""
        data = []
        for rec in self.records:
            data.append({
                'TX ID': rec['transaction_id'][:8] + '...',
                'Originator': rec['originator']['name'],
                'Beneficiary': rec['beneficiary']['name'],
                'Amount': rec['amount'],
                'Applicable': rec['travel_rule_applicable'],
                'Status': rec['compliance_status']
            })
        return pd.DataFrame(data)

# Simulate Travel Rule
travel_rule = TravelRule()

print("Travel Rule Compliance Simulation:")
transactions = [
    {
        'originator': {'name': 'Alice Johnson', 'account': '0x123...', 'address': 'US'},
        'beneficiary': {'name': 'Bob Smith', 'account': '0x456...', 'address': 'UK'},
        'amount': 5000
    },
    {
        'originator': {'name': 'Charlie Brown', 'account': '0x789...', 'address': 'Germany'},
        'beneficiary': {'name': 'Diana Ross', 'account': '0x321...', 'address': 'France'},
        'amount': 2500
    },
    {
        'originator': {'name': 'Eve Wilson', 'account': '0x654...', 'address': 'Singapore'},
        'beneficiary': {'name': 'Frank Davis', 'address': 'US'},  # Missing account
        'amount': 10000
    }
]

for tx in transactions:
    print(f"\nProcessing transaction: ${tx['amount']:,.2f}")
    travel_rule.process_transaction(tx['originator'], tx['beneficiary'], tx['amount'])

print("\nTravel Rule Compliance Report:")
print(travel_rule.get_compliance_report().to_string(index=False))

# ----------------------------------------------------------------
# PART D: AML COMPLIANCE FRAMEWORK
# -----------------------------------------------------------------

print("\n" + "-"*60)
print("PART D: AML Compliance Framework")
print("-"*60)

aml_framework = {
    "Governance": {
        "Requirements": [
            "AML Policy approved by Board",
            "Compliance Officer appointed",
            "Regular reporting to management",
            "Independent audit of AML program"
        ]
    },
    "Customer Due Diligence": {
        "Requirements": [
            "KYC procedures in place",
            "Risk-based approach",
            "Enhanced due diligence for high risk",
            "Ongoing monitoring of customer relationships"
        ]
    },
    "Transaction Monitoring": {
        "Requirements": [
            "Real-time monitoring system",
            "Suspicious activity detection",
            "Alert management process",
            "Case management for investigations"
        ]
    },
    "Reporting": {
        "Requirements": [
            "Suspicious activity reporting",
            "Travel Rule compliance",
            "Threshold reporting",
            "Regulatory submissions"
        ]
    },
    "Training": {
        "Requirements": [
            "Initial training for all staff",
            "Annual refresher training",
            "Specialised training for compliance team",
            "Record of training completion"
        ]
    }
}

for area, details in aml_framework.items():
    print(f"\n{area.upper()}:")
    for req in details['Requirements']:
        print(f"  □ {req}")

# ----------------------------------------------------------------
# PART E: SUMMARY AND RECOMMENDATIONS
# -----------------------------------------------------------------

print("\n" + "="*70)
print("PART E: Summary and Recommendations")
print("="*70)

print("""
AML/CFT and Compliance – Key Takeaways:

1. AML/CFT prevents money laundering and terrorist financing in digital assets.
2. FATF Recommendations provide global standards for VASPs.
3. Travel Rule requires sharing transaction information between VASPs.
4. KYC involves identification, verification, screening, and risk assessment.
5. Enhanced due diligence (EDD) is required for high-risk customers.
6. Transaction monitoring detects suspicious activity through red flags.
7. Reporting obligations include SARs, Travel Rule, and threshold reports.

Compliance Program Framework:
  - Establish governance and policy.
  - Implement customer due diligence procedures.
  - Deploy transaction monitoring systems.
  - Maintain record-keeping and reporting.
  - Train staff regularly.
  - Conduct independent audits.
  - Stay updated on regulatory changes.
""")