Sub topic 2
Scenarios: Turning a Typology into a Rule
This chapter assumes you understand basic money laundering concepts, common transaction types, and basic Python. A scenario is a detection rule that looks for a defined pattern in customer activity.
From a Typology to a Scenario
A typology describes how suspicious activity may work. For example, structuring means splitting cash deposits into amounts below a reporting limit. A monitoring scenario makes that idea testable:
- Transaction type: cash deposit
- Amount range: from 8,000 up to, but not including, 10,000
- Lookback period: seven days
- Minimum count: three deposits
- Grouping key: customer ID
The rule should create an alert only when the defined conditions are met.
Thresholds and Parameters
A threshold is a boundary that helps decide whether activity matches a scenario. A parameter is a configurable value, such as the lookback period or minimum count.
from datetime import datetime, timedelta
transactions = [
{"customer_id": "C1", "type": "cash_deposit", "amount": 9500,
"timestamp": datetime(2026, 3, 2)},
{"customer_id": "C1", "type": "cash_deposit", "amount": 9200,
"timestamp": datetime(2026, 3, 3)},
{"customer_id": "C1", "type": "cash_deposit", "amount": 9800,
"timestamp": datetime(2026, 3, 5)},
]
params = {"lookback_days": 7, "min_count": 3, "floor": 8000, "ceiling": 10000}
window = timedelta(days=params["lookback_days"])
qualifying = [
t for t in transactions
if t["type"] == "cash_deposit"
and params["floor"] <= t["amount"] < params["ceiling"]
]
if len(qualifying) >= params["min_count"]:
print("Create structuring alert")Evaluating the Rule
A lookback window is the period examined for related activity. The system sorts qualifying transactions by time, moves the window across each transaction, and aggregates matching records. A scheduled batch may evaluate all activity nightly. Near-real-time evaluation checks transactions shortly after they arrive. Batch processing is simpler and often cheaper; near-real-time processing can support faster intervention but needs reliable event processing.
Alert Contents and Creation
An alert record should explain why it fired. Common fields include customer ID, scenario name, matched transaction IDs, window start and end, count, total amount, rule version, and creation time. The alert is created when the evaluated activity satisfies the scenario. It is then available for consolidation, scoring, and analyst review.
Exercise
Why might three deposits totaling 28,500 create an alert even though each deposit is below 10,000?
Show answer
The scenario detects repeated deposits within a lookback window, not just one transaction over a threshold.