Sub topic 9
Transaction monitoring rules and scenarios
This chapter assumes you know basic retail banking (accounts, cash deposits, transfers), what money laundering is, and how to read short Python and SQL. It builds on the earlier chapters on typologies, red flags, and customer due diligence (CDD).
What transaction monitoring does
Transaction monitoring is the process of checking customer activity against defined patterns and raising an alert when activity looks unusual or suspicious. An alert is not a finding. It is a prompt for a human to review the account.
A rule is one testable condition, such as "cash deposit between 8,000 and 10,000". A scenario combines rules, a time window, and thresholds to target one typology. Structuring, fan-in and pass-through, and mule-like behaviour each get their own scenario.
Anatomy of a scenario
Every scenario answers the same questions:
| Part | Question | Structuring example |
|---|---|---|
| Population | Which customers or accounts are in scope? | Accounts with cash deposits |
| Event filter | Which transactions count? | Cash deposits from 8,000 up to (not including) 10,000 |
| Window | How far apart can events be? | 3 days |
| Threshold | How many or how much triggers an alert? | At least 3 deposits, combined total over 10,000 |
| Output | What does the analyst see? | Account, start date, total |
A rule in code
The structuring scenario from the earlier chapters is a good example of a windowed rule. It groups deposits by account, then checks each window starting at a deposit.
from collections import defaultdict
from datetime import timedelta
THRESHOLD = 10_000
FLOOR = 8_000
def flag_structuring(deposits, window_days=3, min_count=3):
"""deposits: iterable of (account, date, amount) cash deposits."""
by_account = defaultdict(list)
for account, day, amount in deposits:
by_account[account].append((day, amount))
alerts = []
for account, items in by_account.items():
items.sort()
for i, (start, _) in enumerate(items):
end = start + timedelta(days=window_days)
window = [amt for day, amt in items[i:] if day < end]
near = [amt for amt in window if FLOOR <= amt < THRESHOLD]
if len(near) >= min_count and sum(window) > THRESHOLD:
alerts.append((account, start, sum(window)))
break
return alertsThe parameters window_days, min_count, FLOOR, and THRESHOLD are the tunable values. Changing them changes how many alerts you get.
Aggregate rules in SQL
Some scenarios are simple counts over a period. This query lists accounts that received money from at least five distinct senders in seven days, a starting list for fan-in review.
-- PostgreSQL syntax
SELECT dst_account,
COUNT(DISTINCT src_account) AS distinct_senders,
SUM(amount) AS total_inflow
FROM transfers
WHERE ts >= CURRENT_DATE - INTERVAL '7 days'
GROUP BY dst_account
HAVING COUNT(DISTINCT src_account) >= 5
ORDER BY total_inflow DESC;Fan-in alone is common for legitimate businesses. The Python flag_passthrough function adds a second condition: outflow of at least 90% of inflow. Combining conditions is the main way to cut noise.
Tuning
Tuning is adjusting thresholds so the scenario catches more genuine risk without burying analysts in noise. Two common errors:
- Thresholds set once and never reviewed. Customer behaviour and criminal behaviour both change.
- One threshold for every customer. A market stall and a salaried employee have different normal cash activity. Use CDD data, such as expected monthly cash volume and customer segment, to set different limits per segment.
A practical method is below-the-line and above-the-line testing. Run the scenario with slightly lower and higher thresholds on historical data. Then sample alerts from each band and see whether the extra alerts hold real suspicion. Record the results, because regulators expect you to justify your settings.
Exercise
A scenario flags any account with 5 or more incoming transfers from distinct senders in 7 days. It alerts on a charity that collects weekly donations. Name two ways to reduce this noise without removing the scenario.
Show answer
Add a pass-through condition (outflow of at least 90% of inflow), since a charity keeps or spends funds in different ways. Segment by customer type using CDD data, so that accounts with an expected pattern of many small inbound payments use a higher sender threshold or are excluded from this scenario, while still being covered by others.