Sub topic 11
Detecting Fan-In and Rapid Pass-Through
This chapter assumes you can read short Python and SQL snippets. It also assumes you know what a funnel account is and why transaction monitoring uses rules and thresholds. Here you will turn the funnel pattern into rules you can run and tune.
The pattern in one picture
A funnel account collects money from many people and passes almost all of it on quickly. Two measurable features describe this:
- Fan-in is many distinct senders paying one account in a short period.
- Rapid pass-through is most of that money leaving again soon after it arrives, often to one or a few destinations.
Neither feature is suspicious alone. A shop has fan-in, and a savings account keeps money. The combination, plus a mismatch with what the customer said to expect, is what justifies an alert.
Step 1: Measure fan-in with an aggregate query
Start with distinct counterparties, not transaction counts. Twenty payments from one sender is a different story from twenty payments from twenty senders. The query below lists accounts that received money from at least five distinct senders in the last seven days.
-- 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;On a real transfer table this returns many accounts, including merchants, landlords, and clubs. Treat the output as a review list, not as alerts.
Step 2: Add the outflow test
The signal gets much stronger once you check where the money went. This version joins the fan-in accounts to their outgoing totals over the same window.
-- PostgreSQL syntax
WITH inflow AS (
SELECT dst_account AS account,
COUNT(DISTINCT src_account) AS senders,
SUM(amount) AS total_in
FROM transfers
WHERE ts >= CURRENT_DATE - INTERVAL '7 days'
GROUP BY dst_account
HAVING COUNT(DISTINCT src_account) >= 5
),
outflow AS (
SELECT src_account AS account,
SUM(amount) AS total_out
FROM transfers
WHERE ts >= CURRENT_DATE - INTERVAL '7 days'
GROUP BY src_account
)
SELECT i.account,
i.senders,
i.total_in,
COALESCE(o.total_out, 0) AS total_out,
COALESCE(o.total_out, 0) / i.total_in AS pass_ratio
FROM inflow i
LEFT JOIN outflow o USING (account)
WHERE COALESCE(o.total_out, 0) >= 0.9 * i.total_in
ORDER BY i.total_in DESC;The LEFT JOIN keeps accounts with no outflow, and COALESCE turns the missing total into zero. Those accounts then fail the 0.9 test, as intended.
The weakness of a window total
Both queries compare totals over a whole window. That hides timing. Consider two accounts that each receive 3,000 and send 2,900 during a week:
- Account A sends the money out within hours of each deposit.
- Account B receives money on Monday and pays rent on Friday.
The totals are identical, but only A behaves like a pass-through. The simple Python function from the plan has the same limit. It counts all outflow in the review window, whenever it happened. You can fix this by counting only outflow that happens soon after the inflow.
Step 3: Add time to the pass-through test
The function below counts outgoing money only if it leaves between the first incoming transfer and a holding period after the last one. It returns the figures an analyst needs to read the alert.
from collections import defaultdict
from datetime import datetime, timedelta
def flag_fast_passthrough(transfers, min_sources=5, ratio=0.9,
max_hold=timedelta(hours=24)):
"""transfers: iterable of (timestamp, source, destination, amount).
Returns (account, distinct_senders, inflow, outflow) for accounts that
receive from at least min_sources senders and send out at least
`ratio` of the inflow no later than max_hold after the last deposit.
"""
incoming = defaultdict(list) # destination -> [(ts, source, amount)]
outgoing = defaultdict(list) # source -> [(ts, amount)]
for ts, src, dst, amount in transfers:
incoming[dst].append((ts, src, amount))
outgoing[src].append((ts, amount))
alerts = []
for account, ins in incoming.items():
senders = {src for _, src, _ in ins}
if len(senders) < min_sources:
continue
first = min(ts for ts, _, _ in ins)
last = max(ts for ts, _, _ in ins)
inflow = sum(amount for _, _, amount in ins)
outflow = sum(
amount for ts, amount in outgoing.get(account, [])
if first <= ts <= last + max_hold
)
if outflow >= ratio * inflow:
alerts.append((account, len(senders), inflow, outflow))
return alerts
base = datetime(2026, 11, 2, 9, 0)
transfers = [(base + timedelta(hours=i), f"S{i}", "F", 500) for i in range(6)]
transfers.append((base + timedelta(hours=8), "F", "X", 2900))
print(flag_fast_passthrough(transfers))Running it prints [('F', 6, 3000, 2900)]. Six senders paid 500 each into account F, and 2,900 left for X three hours after the last deposit. If you move the outgoing transfer to base + timedelta(days=4), the list comes back empty, because the money was held.
Choosing and tuning parameters
Each parameter trades missed cases against analyst workload.
| Parameter | Lower value | Higher value |
|---|---|---|
| `min_sources` | More alerts, catches small funnels, floods with retail accounts | Fewer alerts, misses small mule groups |
| `ratio` | Catches accounts that keep a cut, produces more benign alerts | Misses launderers who retain 15 to 20 percent |
| `max_hold` | Only very fast pass-through, easy to evade by waiting | Catches slow movement, picks up ordinary bill payments |
| Review window | Fewer alerts, misses slow collection | More alerts, more benign fan-in |
Do not set these by instinct. Run the rule on historical data, sample the alerts, and record how many analysts judged worth escalating. Repeat when the customer mix or product set changes.
Making the rule use customer context
Raw counts ignore who the customer is. A better rule compares behaviour with the expected activity recorded during customer due diligence (CDD).
- A sole trader whose stated purpose is "online craft sales" should receive many small payments.
- A salaried employee with a basic current account should not.
- A newly opened account with fan-in inside its first weeks deserves more attention than a ten-year-old account.
Useful context fields include customer type, declared occupation or business, account age, and expected monthly turnover. Many teams run the same rule with different thresholds per segment rather than one global setting. The same query can also report inflow as a multiple of declared turnover, which is often easier for an analyst to judge than a raw amount.
Where false positives come from
Accounts that legitimately resemble a funnel include:
- Landlords and letting agents who collect rent and pay owners.
- Payroll and payment processors, which pass money through by design.
- Charities and crowdfunding organisers who collect donations and transfer them.
- Clubs, schools, and group-trip organisers who collect contributions and pay a supplier.
- Marketplace sellers and platform payout accounts.
Handle these with a known-entity list or a customer segment exclusion, but review the list on a schedule. A mule can be onboarded as a "small business" to land in an exclusion. An exclusion based only on the customer's own description is weak. Check it against actual behaviour.
How launderers adapt
Know the evasions so you can judge what the rule cannot see:
- Retention: keeping 15 percent defeats a 0.9 ratio.
- Delay: holding money for longer than
max_hold. - Splitting outflow: sending to many destinations. Your rule still sees the outflow total, but a rule that requires a single destination would not.
- Rotating accounts: each account handles fewer than
min_sourcessenders, so no single account crosses the fan-in line. - Mixed money: blending illicit deposits into genuine business receipts, so the ratio looks normal.
The last two evasions are why account-level rules need to be paired with network analysis. A graph view can link many small accounts that share a destination or a device. That is the topic of the next chapters.
What to record when an alert fires
For each alert, store the figures that explain it: distinct senders, total inflow, total outflow, ratio, time between first deposit and last withdrawal, and the destination accounts. Add the CDD profile and your reason for escalating or closing. This record is the start of the narrative in a suspicious activity report.
Exercise
An account receives 4,000 from eight distinct senders on Monday. On Thursday it sends 3,800 to one destination. A rule with minsources=5, ratio=0.9, and maxhold=24 hours does not alert. A rule with max_hold=96 hours does. Which setting is right?
Show answer
Neither can be judged from these figures alone. The 24-hour rule misses a pass-through that took three days, and the 96-hour rule would also catch ordinary bill payments. Check historical alerts to see how many 24 to 96 hour cases were judged worth escalating. Then check the customer's CDD profile: a landlord paying an owner on Thursday is normal, while a student account doing the same is not.
Exercise
Why does the SQL pass-through query use a LEFT JOIN with COALESCE rather than an INNER JOIN?
Show answer
An INNER JOIN would drop fan-in accounts with no outgoing transfers, so they would never appear in results. That would be harmless for alerting here, but the query would lose the ability to show totalout and passratio for borderline accounts if the filter were loosened or removed. The LEFT JOIN keeps every fan-in account, and COALESCE turns a missing outflow total into zero so the arithmetic and the 0.9 comparison work.