Lending fraud: first-party, synthetic identity, loan stacking
A loan that never pays its first instalment is credit loss or fraud, and the book cannot tell you which. The signals can point, at a price paid by the customers who did nothing wrong
Owoleaf's identity check compares the name on an application with the name on the identity record. 158 loans were approved where the names did not match. The lab's answer key plants synthetic identities (made-up people built from real and invented details). Roughly what share of those 158 loans are synthetic identities?
Credit risk asks whether a borrower who means to repay will be able to. Fraud asks whether the borrower is who they say they are, and whether they mean to repay at all. This chapter is about the defending side: what a lender can see at the door, what each signal costs when it is wrong, and how the response is built so that the customer who did nothing wrong pays as little as possible. It does not describe how to evade any check. The lab is Owoleaf’s loan book at scale 1 (data1/: 8,386 applications, 3,645 loans) with the new signals table that book3.py adds.
Fraud is a different loss from credit loss
A loan that is never repaid can have three origins, and each wants a different response.
| What happened | Name | The lender’s response |
|---|---|---|
| The borrower meant to pay and lost the income | Credit loss | Collections, restructuring, provisioning (modules 2 and 3) |
| The borrower lied about something that matters (income, employer, identity) or took the loan with no plan to repay | First-party fraud | Investigation, recovery where the person is real, a record for next time |
| Someone used another person’s identity, or an identity that does not exist | Third-party fraud and synthetic identity | Stop the credit, find the victim if there is one, never collect from the wrong person |
The ground between the rows is wide. A first-party fraud is a real customer acting dishonestly, so the identity checks pass. Identity theft has a real victim who will eventually complain. The US Federal Reserve’s industry-recommended definition of a synthetic identity is the use of a combination of personally identifiable information to fabricate a person or entity in order to commit a dishonest actas of 2026-11. It is guidance, not a binding rule, and it fits Nigerian lending too: a made-up person has no victim, so nobody complains, and the first sign is a loan that is never repaid.
Fraud comes in more shapes than the book’s three planted ones. Each has a signature the defender can look for:
| Kind | What the lender sees | Where the control sits |
|---|---|---|
| First-party | A real, verified customer who stops at the first instalment, often after borrowing the maximum | Limits that start low, affordability checks, a clean record of first-payment outcomes by channel |
| Synthetic identity | Details that agree with each other but not with an identity record: name, date of birth, phone | Identity verification against the Bank Verification Number (BVN) or National Identification Number (NIN), name matching, a thin or oddly new bureau file |
| Account farm | Many customers on one device, phone or address; applications that arrive in bursts | Device and phone linking across customers |
| Loan stacking | A burst of other lenders’ enquiries in the days before the application, before any of those loans appear on the bureau | The bureau’s enquiry count |
| Collusion | An agent, a merchant or an employer confirms facts that are false (income, employment, a delivery) | Review of agent and employer portfolios, sampling and call-backs |
| Insider fraud | A staff member creates, alters or waives a loan, or diverts a disbursement | Maker-checker, separation of duties, audit logs |
The last two rows are controls, not statistics. The lab has no staff table and no agent field, so its code does not hunt for them. The first four are visible in applicant_signals, and the chapter works through those.
Why the label matters. Three things go wrong when fraud is booked as credit loss. The scorecard learns “no bureau file and a new device” as a risk of ordinary default and charges honest thin-file customers for it. Collections sends reminders and calls to the person on file, who may be a victim, or does not exist; the collections chapter’s contact rules apply to whoever is on the other end. And provisioning (module 3’s IFRS 9 chapter) books an expected loss that is really a control failure. Fraud is a different line in the loss report because the cure is different.
What the lender holds at the door
applicant_signals has one row per application. The generator makes every value up and says so; the real versions come from different sources with different gaps.
| Column | What it stands for | An honest reason for a bad value |
|---|---|---|
device_id |
The phone or browser the application came from | A new phone, a shared family phone, a cyber café, an agent’s tablet |
phone_hash |
A hash of the number given, so the lab never holds a number | A SIM swapped after a loss; one number for a household |
email_domain |
The part of the email after the @ | A privacy-minded customer’s choice of provider |
ip_state |
Where the IP address placed the applicant, or ABROAD |
A mobile network that routes through another state; a traveller; the diaspora |
name_match |
1 if the identity check’s name matched the name given | Spelling, name order, initials, a surname changed on marriage |
other_lender_enquiries_7d |
Other lenders’ bureau enquiries in the 7 days before | Someone shopping for the best offer |
Every signal has an honest explanation, which is the chapter’s theme. A false positive is a good customer the rule flags. The best lenders decide the response to a flag by what it costs the good customer, not by what it would catch.
Two real-world facts frame the identity signals. The Central Bank of Nigeria (CBN) issued a revised framework for BVN operations and watch-list in October 2021. According to search summaries of it, the watch-list holds BVNs of people confirmed to have breached the framework, and a person on it cannot access or guarantee credit facilitiesas of 2026-11. This chapter did not read the framework’s text, so check who may place a BVN on the list, for how long and who can request removal. Press reports (not the circular itself) say a CBN circular of 12 March 2026 amended that framework from 1 May 2026, with a temporary watch-list of up to 24 hours for BVNs linked to suspected fraud, a minimum enrolment age of 18, and restricted access to BVN data for CBN-licensed institutionsas of 2026-11. Other press reports describe liveness checks and device limits as separate measures and differ on dates, so read the CBN’s own text before you rely on any 2026 detail. Whether a lender can reach the watch-list depends on its licence, a module 4 question. Second, an academic appraisal of the Credit Reporting Act 2017 says the Act provides for fraud alerts and the blocking of negative information generated by criminalsas of 2026-11. The Act’s text is on the Judy Legal database (the page previews the Act, assented to on 30 May 2017)as of 2026-11; this chapter did not check the sections, so a lender should. How bureaux record enquiries is in credit data in Nigeria.
Links: devices, phones and rings
A fraud ring is a small group of applicants who are really one actor. The lender cannot see that; it sees different names, different BVNs and, if it looks, the same device or phone. The method is a graph. Treat each customer as a node, join two customers who used the same device or the same phone, and read off the connected groups. The standard-library tool for that is union-find: every customer starts in a group of one, and each shared device or phone merges two groups.
Two things go wrong with it.
Time. When an application arrives, only earlier applications exist. A rule that says “this device has been used by another customer” cannot flag the first customer of a ring, because nobody has used the device yet. In hindsight, with every application in hand, the whole ring is visible. Step 3 counts both: 90 linked in hindsight and 65 in real time. The 25 missed are the first application on each of the 25 shared devices, and every one is a loan that failed its first instalment. A real-time link rule is a rule for the second and later members; the first is found by other signals or after the fact. Hindsight is still useful: it tells you whom to investigate, whose money to try to recover and what to block next time.
Honest sharing. In the lab, an honest customer never shares a device, so the link rule looks perfect. In life a family shares a phone, a market agent registers customers on one tablet, a cyber café serves a street. A rule that treats every shared device as fraud blocks them. The break step builds exactly that case.
Union-find also shows what a ring looks like in the book. The lab has 25 shared devices and 25 shared phones, but 23 linked groups: in step 2, group 4 spans two devices, joined through a customer who appears on both.
Name mismatches and synthetic identities
The identity check returns whether the name on the record matches the name the applicant gave. A synthetic identity often fails it, because its details were assembled from more than one source. So do honest customers: a name written in a different order, a spelling variant (Muhammad and Mohammed), a name with an accent or an apostrophe the system drops, a woman whose surname changed after marriage, a first name used as a second. A model or a clerk judging “close enough” is judging Nigerian names, and a matcher built on other naming conventions will fail more of ours.
Count before you decide. In the book, 310 applications fail the check, and 158 of them became loans. Of those 158, 59 failed their first instalment, 37.3%, against 8.5% for all 3,645 loans: a mismatch is 4.4 times as likely to be a first-payment default. That is a strong signal and a weak decision rule, because 99 of the 158 did pay. The arithmetic is the base rate problem: fraud is rare, so even a good signal is mostly wrong when it fires. Step 4 gives the table. Step 7 opens the key, and the answer is 55 of the 158, not 59: first-payment default overstates it, because fraud is only a part of what fails a first instalment.
According to law-firm summaries, section 37 of the Nigeria Data Protection Act 2023 limits decisions based solely on automated processing, including profiling, that have legal or similar effects, with exceptions such as consent, law or contract, and entitles people to ask for human involvement and to contest the decisionas of 2026-11. This chapter did not read the Act’s verbatim text (a copy is hosted by Nigeria’s national CERT), and commentators differ on the exceptions, so a lender reads the Act. The design point is plain. A decline made by a points table on a name mismatch is an automated decision about a person. A step-up that ends with a human looking at the case is a safer shape, and it is also what the arithmetic recommends.
Loan stacking
A stacker takes loans from several lenders in a few days, before any of them reports to a bureau. The first lender’s loan is not yet on the file when the second lender looks. What is on the file already is the enquiry: each lender asks the bureau before it lends. other_lender_enquiries_7d counts them for the week before the application. A person comparing offers also generates enquiries, so the threshold is a trade, and step 4 shows it:
| Enquiries in 7 days | Loans | First-payment defaults | Rate |
|---|---|---|---|
| 3 or more | 74 | 54 | 73.0% |
| 4 or more | 44 | 42 | 95.5% |
| 5 or more | 35 | 34 | 97.1% |
Each step up the threshold gives away some stackers and removes a lot of honest shoppers. How far to go is a price decision, which the cost section below sets.
Stacking is also why a bureau relationship matters more than a bureau score. A lender that reports its own loans quickly and reads enquiries promptly narrows the window. A lender that is slow gives stackers the gap.
Collusion and insiders
Signals describe applicants. Collusion and insider fraud involve people on the lender’s side, or one step away: an agent who coaches applicants, a merchant who confirms a purchase that did not happen, an employer’s clerk who confirms a salary that is not paid, a staff member who approves, edits or waives a loan. Because they pass the applicant checks by design, the controls are procedural. Maker-checker means one person creates a loan and a different person approves it. Separation of duties means the person who disburses does not reconcile. Audit logs record who changed what. Portfolio reviews compare each agent’s, merchant’s and employer’s first-payment default rate with the book’s, and sample their files. The Association of Certified Fraud Examiners (ACFE) publishes the Fraud Tree, a standard map of occupational fraud, groups these schemes under asset misappropriation, corruption and financial statement fraud: see Reading.
A law-firm commentary (Templars) says that under section 22 of the Cybercrimes (Prohibition, Prevention, etc.) Act 2015 an employee of a financial institution who uses special knowledge to commit identity theft or impersonation against the employer, staff or service providers is covered, and that the 2024 amendment, signed on 28 February 2024, expanded the scope of identity theft and impersonation to staff of other organisationsas of 2026-11. The official texts are on the Judy Legal database, where the amendment is described only as inserting consequential words omitted from the Actas of 2026-11, so sources disagree on how far the amendment goes. This chapter did not read section 22 and states no penalties: a lender takes legal advice. Fraud reporting duties, sanctions and the wider fraud systems of a lender belong to the Compliance course (not written yet).
From signals to a response
A fraud rule is a decision under uncertainty, and the response has to fit the confidence. The ladder the lab uses has three rungs.
- Pass. No flag, or too weak to bother anyone.
- Step-up. A flag worth a further proof: a fresh identity check, a call to the number given, a lower first limit. A fraudster usually fails this; a good customer loses a minute, and some give up.
- Review. A person looks at the file before any money moves. Slow and costly, so it is kept for strong or stacked flags.
Each signal adds points, and the total sets the rung. The lab’s points are illustrative: 60 for a link to an earlier customer’s device or phone, 30 for a name mismatch, 50 for five or more enquiries and 20 for three or four, 20 for an IP address abroad. Step-up starts at 30 points and review at 60. No single weak signal reaches review, and no rung is an automatic decline.
The ladder has a price on each rung, and the lab puts it in one function with the inputs in plain sight: a step-up costs ₦300 of work and loses 15% of good customers; a review costs ₦1,500 and loses 30%; a step-up stops half of real fraud and a review 90%; each lost good loan is worth ₦2,000. These are assumptions, not findings. What the function shows is the shape: fraud avoided, less the cost of the work, less the customers lost. Change an input and watch the net move.
Two traps in this arithmetic.
A perfect signal is a warning. In the book, every one of the 50 applications from protonmail.com and every one of the 26 from an ABROAD IP address became a loan that failed its first instalment (step 4). That is how the generator draws its rings, not how the world is. In real life a privacy-minded customer, a student abroad or a nurse on a posting would trip those rules, and a rule on a domain or a country is a proxy that treats a group of people alike (module 3’s chapter on fairness in AI credit takes the test). The lab’s rule set uses the IP signal for a small number of points, never alone enough for a step-up, and leaves the email domain out.
The label. Before you hold a key you measure against what you can see, and that is first-payment default. In the lab 310 loans failed their first instalment and 142 were fraud. A rule scored against the first number looks better than the second, and not by accident: fraud is a subset of it. The key only labels fraud that was approved and then failed. Fraud that a rule stopped never became a loan and is in no key. The better the control, the less fraud the book can show.
Back at Owoleaf
Aramide and Ashake take a rule set to the lending team: points, three rungs, no automatic declines, a reason code on every flag so that a customer who asks can be told, and a cost table the team can change. They also agree what the rules cannot do. A ring’s first member passes. A stacker with three or four enquiries passes. An agent’s customers would be caught by the link rule unless the agent’s device is on a list. And the numbers come with the right label: first-payment default is the question to ask a flagged group, not the proof that it was fraud.
You build one file, fraud.py, in labs/finance, adding to it each step. Step 7 and the break step import it. Everything reads data1/finance.sqlite read-only. Do not open data1/answers/lending_fraud_truth.csv until step 7: a real lender has no file that says which applications were fraud, and the point of the lab is to see how far the signals get without it. Money is integer kobo (the naira() helper prints it with no float); every price and figure is illustrative.
0. Build the scale 1 book, with the signals. Skip the first command if data1/ already holds the loan, card and collections tables. book3.py adds the three new tables and changes no existing one.
cd labs/finance
python3 generate.py --scale 1 --out data1 && python3 loans.py --out data1 \
&& python3 cards.py --out data1 && python3 collect.py --out data1
python3 book3.py --out data1
python3 check.py --db data1/finance.sqlite8386 application signals, 40 employers, 1959 salary advances with an employer
planted fraud (answers/lending_fraud_truth.csv): account_farm 35, loan_stacking 52, synthetic_identity 55
loan book: 3645 loans, 9,771,721,819 kobo of principal outstanding; checks 7-11 run
card book: 100,972 card attempts, 1065 disputes for 1,189,430,900 kobo; checks 12-15 run
collections: 15,831 actions, 1274 promises, 368 placements; checks 16-18 run
application signals: 8,386; checks 19-20 run
...
OK: all invariants holdbook3.py prints the planted fraud: 142 loans in all, which you do not use until step 7. The end of check.py’s output is shown, with the accounts lines between left out, and checks 19 and 20 cover the new tables. check.py takes about 30 seconds.
1. Load every application with its signals and its outcome. Save as fraud.py. load() joins an application to its signals, its customer and its loan if it has one, and marks a loan fpd (first-payment default) when its first instalment fell due by the cut-off and was not paid in full.
"""fraud.py: application-fraud signals on the lab's loan book (data1, scale 1).
Standard library only. Money is integer kobo. Every figure is illustrative.
Later steps import this file: `import fraud as f`.
"""
import collections
import sqlite3
DB = "data1/finance.sqlite"
def connect():
return sqlite3.connect(f"file:{DB}?mode=ro", uri=True)
def naira(kobo):
"""Integer kobo as text, ₦ and kobo, with no float anywhere."""
return f"{kobo // 100:,}.{kobo % 100:02d}"
def load():
"""One dict per application: its signals, its customer, and the loan it became (None if declined).
fpd (first-payment default) is 1 when the loan's first instalment fell due by the cut-off and was not paid in full."""
db = connect()
cut_off = db.execute("SELECT value FROM loan_book_meta WHERE key = 'cut_off'").fetchone()[0]
paid = {(l, n): k for l, n, k in db.execute(
"SELECT loan_id, instalment, SUM(amount_kobo - late_fee_kobo) FROM repayments GROUP BY 1, 2")}
first_due = {l: (d, t) for l, d, t in db.execute(
"SELECT loan_id, due_date, total_kobo FROM schedule WHERE instalment = 1")}
rows = []
for (app, cust, product, channel, applied, decision, asked, tier, state, signup, dev, phone, email, ip, match, enq,
loan, principal, status, outstanding) in db.execute("""
SELECT a.id, a.customer_id, a.product, a.channel, a.applied_at, a.decision, a.requested_kobo,
c.kyc_tier, c.state, c.signup_at, s.device_id, s.phone_hash, s.email_domain, s.ip_state,
s.name_match, s.other_lender_enquiries_7d,
l.id, l.principal_kobo, l.status, l.outstanding_principal_kobo
FROM applications a JOIN applicant_signals s ON s.application_id = a.id
JOIN customers c ON c.id = a.customer_id
LEFT JOIN loans l ON l.application_id = a.id ORDER BY a.applied_at, a.id"""):
fpd = None
if loan:
due, total = first_due[loan]
fpd = int(due <= cut_off and paid.get((loan, 1), 0) < total)
rows.append(dict(app=app, cust=cust, product=product, channel=channel, applied=applied, decision=decision,
asked=asked, tier=tier, state=state, signup=signup, device=dev, phone=phone, email=email,
ip=ip, match=match, enq7=enq, loan=loan, principal=principal, status=status,
outstanding=outstanding, fpd=fpd))
return rows
def profile(rows):
loans = [r for r in rows if r["loan"]]
print(f"applications {len(rows)}, approved loans {len(loans)}, customers {len({r['cust'] for r in rows})}")
print(f"distinct devices {len({r['device'] for r in rows})}, distinct phones {len({r['phone'] for r in rows})}")
print(f"name did not match: {sum(1 for r in rows if not r['match'])}")
print(f"IP address abroad: {sum(1 for r in rows if r['ip'] == 'ABROAD')}")
print(f"protonmail.com: {sum(1 for r in rows if r['email'] == 'protonmail.com')}")
print("other lenders' enquiries in the 7 days before:")
c = collections.Counter(r["enq7"] for r in rows)
print(" " + " ".join(f"{k}:{c[k]}" for k in sorted(c)))
fp = [r for r in loans if r["fpd"] is not None]
print(f"loans with a first instalment due by the cut-off: {len(fp)}; first-payment defaults: {sum(r['fpd'] for r in fp)}")python3 -c "import fraud as f; f.profile(f.load())"applications 8386, approved loans 3645, customers 6015
distinct devices 5986, distinct phones 5986
name did not match: 310
IP address abroad: 26
protonmail.com: 50
other lenders' enquiries in the 7 days before:
0:6634 1:1384 2:259 3:57 4:13 5:15 6:11 7:5 8:8
loans with a first instalment due by the cut-off: 3645; first-payment defaults: 310Every one of the 3,645 loans has had its first instalment fall due by the cut-off, and 310 failed it: 8.5% of the book. Most enquiry counts are 0 or 1; the tail from 3 to 8 is short and holds the stackers and the honest shoppers together. 50 applications use protonmail.com and 26 come from abroad: remember those.
2. Link customers who share a device or a phone. Add this to the end of fraud.py. components() is the union-find: customers who share a device or a phone fall in one group. show_group() prints one group’s applications.
def shared(rows, key):
"""{value: set of customers} for every device (key 'device') or phone (key 'phone') used by 2+ customers."""
users = collections.defaultdict(set)
for r in rows:
users[r[key]].add(r["cust"])
return {v: c for v, c in users.items() if len(c) > 1}
def components(rows):
"""Link customers who share a device or a phone; return {customer: component id} for linked customers only.
Union-find: every customer starts alone; sharing a device or phone merges two groups."""
parent = {}
def find(x):
parent.setdefault(x, x)
while parent[x] != x:
parent[x] = parent[parent[x]]
x = parent[x]
return x
for key in ("device", "phone"):
for custs in shared(rows, key).values():
first, *rest = sorted(custs)
for c in rest:
parent[find(c)] = find(first)
groups = collections.defaultdict(list)
for c in list(parent):
groups[find(c)].append(c)
return {c: i for i, (_, members) in enumerate(sorted(groups.items(), key=lambda kv: min(kv[1])), 1) for c in members}
def show_links(rows):
for key in ("device", "phone"):
s = shared(rows, key)
sizes = collections.Counter(len(c) for c in s.values())
print(f"{key}s used by 2+ customers: {len(s)}; customers per {key}: {dict(sorted(sizes.items()))}")
comp = components(rows)
by = collections.defaultdict(set)
for c, i in comp.items():
by[i].add(c)
print(f"linked groups: {len(by)}, customers in them: {len(comp)}")
print("group customers applications loans first-pay defaults")
for i, members in sorted(by.items()):
apps = [r for r in rows if r["cust"] in members]
loans = [r for r in apps if r["loan"]]
print(f"{i:>5}{len(members):>11}{len(apps):>14}{len(loans):>7}{sum(r['fpd'] or 0 for r in loans):>20}")
def show_group(rows, n):
"""Print every application from linked group n."""
comp = components(rows)
print("app customer applied product asked device state ip name email status fpd")
for r in rows:
if comp.get(r["cust"]) == n:
print(f"{r['app']:<6}{r['cust']:<10}{r['applied'][:10]} {r['product']:<5}{r['asked'] // 100:>10,} "
f"{r['device'][-4:]:<8}{r['state']:<9}{r['ip']:<9}{'ok' if r['match'] else 'NO':<6}{r['email']:<16}"
f"{(r['status'] or r['decision']):<12}{'' if r['fpd'] is None else r['fpd']}")python3 -c "import fraud as f; r = f.load(); f.show_links(r); print(); f.show_group(r, 4)"devices used by 2+ customers: 25; customers per device: {3: 10, 4: 15}
phones used by 2+ customers: 25; customers per phone: {3: 10, 4: 15}
linked groups: 23, customers in them: 88
group customers applications loans first-pay defaults
1 4 6 6 4
2 3 5 4 3
3 4 5 5 4
4 6 9 8 7
5 4 6 4 4
6 7 9 9 8
7 4 8 5 4
8 4 6 5 4
9 4 6 5 5
10 4 5 5 5
11 4 6 6 5
12 3 4 4 4
13 4 5 5 5
14 4 5 5 4
15 4 7 5 4
16 4 4 4 4
17 3 5 5 3
18 3 4 4 3
19 3 4 3 3
20 3 3 3 3
21 3 6 5 3
22 3 5 3 3
23 3 4 4 3
app customer applied product asked device state ip name email status fpd
8029 19156 2026-01-26 SAL 57,000 b17a Oyo Oyo ok mail.com declined
8266 19765 2026-02-22 SAL 40,000 a964 Lagos Lagos ok outlook.com written_off 1
8053 19233 2026-04-02 SAL 15,000 a964 Lagos Delta NO protonmail.com default 1
7966 18988 2026-05-31 SAL 78,000 a964 Lagos ABROAD ok protonmail.com default 1
7967 18988 2026-06-10 SAL 48,000 36b4 Lagos Kaduna NO protonmail.com default 1
8030 19156 2026-06-10 SAL 26,000 36b4 Oyo Enugu NO outlook.com default 1
497 1189 2026-06-19 SAL 102,000 36b4 Delta Lagos NO protonmail.com default 1
965 2231 2026-06-19 BNPL 67,000 1491 Lagos Lagos ok mail.com closed 0
964 2231 2026-06-22 BNPL 48,000 36b4 Lagos Lagos NO protonmail.com default 125 devices and 25 phones are each used by 3 or 4 customers, and they form 23 groups. Group 4 shows why: two devices (a964 and 36b4) are joined by customer 18988, who used both. The two numbers inside a group, applications and loans, differ because a customer can also apply from their own device (customer 2231’s first application, on device 1491, was repaid), and the lab does not say why. The 23 groups hold 88 customers and 127 applications; 112 became loans and 95 of those failed their first instalment.
3. Link in real time and in hindsight. Add the two link rules to fraud.py. later_link() sees every application. earlier_link() sees only the ones before, as a live rule would.
def earlier_link(rows):
"""The real-time version of 'shared': set of application ids where, on the day it arrived, an earlier application
from a different customer had used the same device or the same phone. Rows are in time order."""
seen = {"device": collections.defaultdict(set), "phone": collections.defaultdict(set)}
hit = set()
for r in rows:
for key in ("device", "phone"):
if seen[key][r[key]] - {r["cust"]}:
hit.add(r["app"])
seen[key][r[key]].add(r["cust"])
return hit
def later_link(rows):
"""The hindsight version: the device or phone is shared with a different customer at any time."""
hit = set()
for key in ("device", "phone"):
users = collections.defaultdict(set)
for r in rows:
users[r[key]].add(r["cust"])
hit |= {r["app"] for r in rows if len(users[r[key]]) > 1}
return hitpython3 - <<'PY'
import fraud as f
r = f.load()
later, early = f.later_link(r), f.earlier_link(r)
print(f"linked in hindsight {len(later)}, linked in real time {len(early)}, missed in real time {len(later - early)}")
miss = [x for x in r if x["app"] in later - early]
print(f"the {len(miss)} missed: {sum(1 for x in miss if x['loan'])} loans, {sum(x['fpd'] for x in miss if x['loan'])} first-payment defaults")
firsts = {}
for x in r:
if x["app"] in later:
firsts.setdefault(x["device"], x["app"])
print(f"first application on each shared device: {len(firsts)}")
PYlinked in hindsight 90, linked in real time 65, missed in real time 25
the 25 missed: 25 loans, 25 first-payment defaults
first application on each shared device: 25The 25 applications a live rule cannot link are the first on each of the 25 shared devices, and all 25 failed their first instalment. The first member of a ring is not catchable by this signal on the day. That is a limit of the rule, not of the data.
4. Judge each signal on its own, by what you can see. Add rule_table() to fraud.py. It counts, for any rule, the applications it hits, how many became loans and how those loans did on the first instalment. Then run it on every signal in the table.
def rule_table(rows, rules):
"""For each rule: applications hit, how many became loans, and how those loans did on the first instalment."""
loans = [r for r in rows if r["loan"]]
base = sum(r["fpd"] for r in loans) / len(loans)
print(f"all {len(loans)} loans: first-payment default {base:.1%}")
print(f"{'rule':<28}{'apps':>6}{'loans':>7}{'fpd':>5}{'fpd rate':>10}")
for name, test in rules.items():
hit = [r for r in rows if test(r)]
hl = [r for r in hit if r["loan"]]
f = sum(r["fpd"] for r in hl)
print(f"{name:<28}{len(hit):>6}{len(hl):>7}{f:>5}{(f / len(hl) if hl else 0):>10.1%}")python3 - <<'PY'
import fraud as f
r = f.load()
early = f.earlier_link(r)
f.rule_table(r, {
"linked earlier (real time)": lambda x: x["app"] in early,
"name did not match": lambda x: not x["match"],
"enquiries in 7 days >= 3": lambda x: x["enq7"] >= 3,
"enquiries in 7 days >= 4": lambda x: x["enq7"] >= 4,
"enquiries in 7 days >= 5": lambda x: x["enq7"] >= 5,
"IP address abroad": lambda x: x["ip"] == "ABROAD",
"email protonmail.com": lambda x: x["email"] == "protonmail.com",
"IP state not home state": lambda x: x["ip"] not in (x["state"], "ABROAD"),
})
PYall 3645 loans: first-payment default 8.5%
rule apps loans fpd fpd rate
linked earlier (real time) 65 65 65 100.0%
name did not match 310 158 59 37.3%
enquiries in 7 days >= 3 109 74 54 73.0%
enquiries in 7 days >= 4 52 44 42 95.5%
enquiries in 7 days >= 5 39 35 34 97.1%
IP address abroad 26 26 26 100.0%
email protonmail.com 50 50 50 100.0%
IP state not home state 937 420 81 19.3%Against 8.5% for the whole book. The name check fires 310 times but only 158 of those became loans, and only 37.3% of those failed. Stacking at 3 enquiries catches more and is less sure than at 5. Three rows are near 100%: the link, the foreign IP address and protonmail.com. The next section of the chapter says why not to trust a perfect rule, and the lab’s rule set leaves the email domain out. An IP state different from the customer’s home state flags 937 applications at 19.3%: weak and noisy, left out too.
5. Build the rule set and read it by rung. Add the points, the ladder and show_rules() to fraud.py.
# ---- a rule set -------------------------------------------------------------------------------------
# Points per signal, and what the total does. ILLUSTRATIVE: set to be changed, not copied.
POINTS = {"linked_earlier": 60, "name_mismatch": 30, "stacking_5plus": 50, "stacking_3_4": 20, "ip_abroad": 20}
STEP_UP_AT, REVIEW_AT = 30, 60 # 30+ points: ask for more proof; 60+: a person reviews before any money moves
def score(r, linked):
"""Points and the reasons for them. `linked` is the set of application ids with an earlier link."""
why = []
if r["app"] in linked:
why.append("linked_earlier")
if not r["match"]:
why.append("name_mismatch")
if r["enq7"] >= 5:
why.append("stacking_5plus")
elif r["enq7"] >= 3:
why.append("stacking_3_4")
if r["ip"] == "ABROAD":
why.append("ip_abroad")
return sum(POINTS[w] for w in why), why
def action(points):
return "review" if points >= REVIEW_AT else "step_up" if points >= STEP_UP_AT else "pass"
def run_rules(rows):
"""{application id: (points, reasons, action)} for every application, in time order."""
linked = earlier_link(rows)
out = {}
for r in rows:
p, why = score(r, linked)
out[r["app"]] = (p, why, action(p))
return out
def show_rules(rows):
res = run_rules(rows)
loans = [r for r in rows if r["loan"]]
print("action applications loans first-pay defaults first instalment paid outstanding on the defaults")
for a in ("pass", "step_up", "review"):
apps = [r for r in rows if res[r["app"]][2] == a]
ln = [r for r in apps if r["loan"]]
d = [r for r in ln if r["fpd"]]
print(f"{a:<10}{len(apps):>10}{len(ln):>9}{len(d):>14}{len(ln) - len(d):>24}"
f"{naira(sum(r['outstanding'] for r in d)):>25}")
print(f"loans {len(loans)}")python3 -c "import fraud as f; f.show_rules(f.load())"action applications loans first-pay defaults first instalment paid outstanding on the defaults
pass 8011 3426 191 3235 6,460,984.95
step_up 310 154 54 100 1,178,902.00
review 65 65 65 0 1,933,661.00
loans 3645375 applications are flagged out of 8,386: 310 for step-up and 65 for review. Of the 154 loans at step-up, 54 failed their first instalment and 100 did not. All 65 reviewed loans failed. The step-up count includes applications the lender had already declined for other reasons: 156 of the 375 flagged applications never became loans, so they carry no outcome and cost work only.
6. Put a price on it. Add the cost function. Every input is at the top and every one is an assumption: change them.
# ---- cost: all inputs ILLUSTRATIVE, integer kobo -------------------------------------------------------
WORK_COST = {"step_up": 30_000, "review": 150_000} # one extra identity check ₦300; one analyst review ₦1,500
CATCH_PCT = {"step_up": 50, "review": 90} # per cent of real fraud each action stops (assumption)
GOOD_LOST_PCT = {"step_up": 15, "review": 30} # per cent of good customers who give up or are wrongly declined
LOAN_VALUE = 200_000 # what one lost good loan would have earned: ₦2,000
def cost_table(rows, is_bad):
"""Net value of the rules per action. is_bad(r) says whether an approved loan counts as fraud: first-payment
default before you know better, the key at the end. Only approved loans can be judged, so declined
applications that were flagged cost work but are not counted as lost customers or avoided losses."""
res = run_rules(rows)
print(f"{'action':<9}{'flagged':>8}{'loans':>7}{'bad':>5}{'good':>6}{'loss avoided':>14}{'work':>9}{'good lost':>11}{'net':>10}")
total = 0
for a in ("step_up", "review"):
apps = [r for r in rows if res[r["app"]][2] == a]
loans = [r for r in apps if r["loan"]]
bad = [r for r in loans if is_bad(r)]
good = len(loans) - len(bad)
avoided = sum(r["outstanding"] for r in bad) * CATCH_PCT[a] // 100
work = len(apps) * WORK_COST[a]
lost = good * GOOD_LOST_PCT[a] * LOAN_VALUE // 100
net = avoided - work - lost
total += net
print(f"{a:<9}{len(apps):>8}{len(loans):>7}{len(bad):>5}{good:>6}{avoided // 100:>14,}{work // 100:>9,}{lost // 100:>11,}{net // 100:>10,}")
print(f"net value of the rule set: ₦{total // 100:,}")python3 -c "
import fraud as f
r = f.load(); f.cost_table(r, lambda x: x['fpd'] == 1)"action flagged loans bad good loss avoided work good lost net
step_up 310 154 54 100 589,451 93,000 30,000 466,451
review 65 65 65 0 1,740,294 97,500 0 1,642,794
net value of the rule set: ₦2,109,245Work out step-up by hand: 54 bad loans have ₦1,178,902.00 outstanding; half is ₦589,451. Work is 310 × ₦300 = ₦93,000. Good loans lost are 100 × 15% × ₦2,000 = ₦30,000. Net: 589,451 − 93,000 − 30,000 = ₦466,451. Review: 90% of ₦1,933,661.00 is ₦1,740,294 (to the naira), less 65 × ₦1,500 = ₦97,500, so ₦1,642,794. The numbers use first-payment default as the label, which this chapter says overstates fraud. Step 7 repeats it with the key.
7. Open the key and score the rules. The lab’s rule set is fixed. Now, and not before, add the key and score it. lending_fraud_truth.csv has one row per fraud loan: its application, its ring (if any) and its kind.
# ---- the answer key: open it only when you have fixed your rules -------------------------------------
def load_key(path="data1/answers/lending_fraud_truth.csv"):
import csv
return {int(r["application_id"]): r for r in csv.DictReader(open(path))}
def score_against_key(rows):
key = load_key()
res = run_rules(rows)
loans = [r for r in rows if r["loan"]]
fraud = [r for r in loans if r["app"] in key]
print(f"approved loans {len(loans)}; in the key: {len(fraud)}; "
f"{collections.Counter(key[r['app']]['kind'] for r in fraud)}")
print(f"{'action':<9}{'loans':>6}{'fraud':>7}{'precision':>11} by kind")
for a in ("pass", "step_up", "review"):
ln = [r for r in loans if res[r["app"]][2] == a]
fr = [r for r in ln if r["app"] in key]
kinds = collections.Counter(key[r["app"]]["kind"] for r in fr)
print(f"{a:<9}{len(ln):>6}{len(fr):>7}{len(fr) / len(ln):>11.1%} {dict(sorted(kinds.items()))}")
caught = [r for r in fraud if res[r["app"]][2] != "pass"]
print(f"recall: {len(caught)} of {len(fraud)} fraud loans flagged ({len(caught) / len(fraud):.1%})")
print("by kind:")
for kind in ("synthetic_identity", "account_farm", "loan_stacking"):
k = [r for r in fraud if key[r["app"]]["kind"] == kind]
print(f" {kind:<20}{sum(1 for r in k if res[r['app']][2] != 'pass'):>4} of {len(k)}")
fpd = [r for r in loans if r["fpd"]]
print(f"first-payment defaults {len(fpd)}, of which fraud {sum(1 for r in fpd if r['app'] in key)}")
print()
cost_table(rows, lambda r: r["app"] in key)
def show_misses(rows):
"""The fraud loans the rules passed, by kind; for ring members, was it the ring's first application?"""
key = load_key()
res = run_rules(rows)
ring_first = {}
for r in rows:
ring = key.get(r["app"], {}).get("ring")
if ring:
ring_first.setdefault(ring, r["app"]) # rows are in time order
missed = [r for r in rows if r["loan"] and r["app"] in key and res[r["app"]][2] == "pass"]
k = [r for r in missed if key[r["app"]]["kind"] == "account_farm"]
firsts = sum(1 for r in k if ring_first[key[r["app"]]["ring"]] == r["app"])
print(f"account_farm missed {len(k)}; the first application of its ring: {firsts}")
k = [r for r in missed if key[r["app"]]["kind"] == "loan_stacking"]
enq = collections.Counter(r["enq7"] for r in k)
print(f"loan_stacking missed {len(k)}; enquiries in the 7 days before: {dict(sorted(enq.items()))}")python3 -c "import fraud as f; r = f.load(); f.score_against_key(r); print(); f.show_misses(r)"approved loans 3645; in the key: 142; Counter({'synthetic_identity': 55, 'loan_stacking': 52, 'account_farm': 35})
action loans fraud precision by kind
pass 3426 27 0.8% {'account_farm': 9, 'loan_stacking': 18}
step_up 154 50 32.5% {'loan_stacking': 34, 'synthetic_identity': 16}
review 65 65 100.0% {'account_farm': 26, 'synthetic_identity': 39}
recall: 115 of 142 fraud loans flagged (81.0%)
by kind:
synthetic_identity 55 of 55
account_farm 26 of 35
loan_stacking 34 of 52
first-payment defaults 310, of which fraud 142
action flagged loans bad good loss avoided work good lost net
step_up 310 154 50 104 540,982 93,000 31,200 416,782
review 65 65 65 0 1,740,294 97,500 0 1,642,794
net value of the rule set: ₦2,059,576
account_farm missed 9; the first application of its ring: 9
loan_stacking missed 18; enquiries in the 7 days before: {3: 10, 4: 8}The rules flag 115 of the 142 fraud loans: 81.0%. All 55 synthetic identities are flagged; 26 of 35 account-farm loans; 34 of 52 stackers. At review, precision is 65 of 65. At step-up it is 50 of 154: 32.5%, so 104 customers who were not in the key were asked for more. Of the 27 passed, nine are account-farm loans, each the first application in its ring, as step 3 predicted; and 18 are stackers with only 3 or 4 enquiries, the threshold the rule set leaves alone because lowering it costs honest shoppers. With the key the net is ₦2,059,576, below the ₦2,109,245 of step 6, because 168 of the 310 first-payment defaults were not fraud and the proxy counted them. Fraud declined before it became a loan is in no key.
This is why every precision and recall figure here is measured on approved loans only. The 3,645 loans are what the lender’s existing decisions let through; the 156 flagged applications that never became loans have no outcome, so they carry work cost and no verdict. A rule set run at the door would meet those applicants too, and some may have been fraud the old process already stopped. Read the figures as how the rules do on what got through, not on all applicants.
Break it: one agent’s phone. A market agent registers eight ordinary customers from one device. Edit them into a copy in memory (the book is untouched), and run the rule set.
python3 - <<'PY'
import copy
import fraud as f
rows = f.load()
agent = [] # eight ordinary salary-advance customers
for r in rows:
if r["loan"] and r["product"] == "SAL" and not r["fpd"] and r["match"] and r["enq7"] == 0 \
and r["cust"] not in {a["cust"] for a in agent}:
agent.append(r)
if len(agent) == 8:
break
ids = {a["app"] for a in agent}
shared = copy.deepcopy(rows)
for r in shared: # now they all come from one agent's device and phone
if r["app"] in ids:
r["device"], r["phone"] = "dev_agent_01", "phone_agent_01"
def show(label, rows):
res = f.run_rules(rows)
rungs = {a: sum(1 for i in ids if res[i][2] == a) for a in ("pass", "step_up", "review")}
print(f"{label:<22}agent's 8 customers: {rungs}; reviews {sum(1 for v in res.values() if v[2] == 'review')}")
show("as generated", rows)
show("one agent device", shared)
f.POINTS["linked_earlier"] = 40
show("link worth 40 points", shared)
f.score_against_key(shared)
PYas generated agent's 8 customers: {'pass': 8, 'step_up': 0, 'review': 0}; reviews 65
one agent device agent's 8 customers: {'pass': 1, 'step_up': 0, 'review': 7}; reviews 72
link worth 40 points agent's 8 customers: {'pass': 1, 'step_up': 7, 'review': 0}; reviews 50
approved loans 3645; in the key: 142; Counter({'synthetic_identity': 55, 'loan_stacking': 52, 'account_farm': 35})
action loans fraud precision by kind
pass 3419 27 0.8% {'account_farm': 9, 'loan_stacking': 18}
step_up 176 65 36.9% {'account_farm': 15, 'loan_stacking': 34, 'synthetic_identity': 16}
review 50 50 100.0% {'account_farm': 11, 'synthetic_identity': 39}
recall: 115 of 142 fraud loans flagged (81.0%)
by kind:
synthetic_identity 55 of 55
account_farm 26 of 35
loan_stacking 34 of 52
first-payment defaults 310, of which fraud 142
action flagged loans bad good loss avoided work good lost net
step_up 332 176 65 111 855,543 99,600 33,300 722,643
review 50 50 50 0 1,174,084 75,000 0 1,099,084
net value of the rule set: ₦1,821,727With one agent’s device, seven of the eight honest customers go to review: the first application is not linked yet, and the rest are, so the lab’s rule treats the agent as a ring. The review queue grows from 65 to 72, and seven people who did nothing wrong wait for a person. Lowering the link’s weight to 40 sends all seven to step-up instead, and no honest customer reaches review. The price is in the key: 15 account-farm loans that reached review now stop at step-up, where the lab assumes only half of fraud is caught, and the net falls from ₦2,059,576 to ₦1,821,727 on the lab’s assumptions. There is no free fix. A better one is a list of devices known to belong to registered agents, which you maintain and audit, and a link rule that needs a second signal before review.
Template
# Fraud case review and rule proposal: <pattern>, <period>
Owner: <fraud analyst>. Signed by: <head of fraud and risk>. Date: <date>. Data to: <cut-off>.
## 1. The pattern
<What the applications share: device, phone, name mismatch, enquiries. Groups, customers, applications, loans.>
## 2. Losses and accounts
- Loans that failed their first instalment: <n of n> Outstanding on them: <₦>
- Accounts involved: <customer ids> Label used: <first-payment default | key>
## 3. Proposed rule
<Signal, points, rung (pass, step-up, review), reason code shown to the customer.>
## 4. Catch rate and false-positive rate
| | Count | Out of | Rate |
|---|---|---|---|
| Fraud the rule flags (catch rate) | | | |
| Honest customers it flags (false positives) | | | |
Cost assumptions: <work per case, per cent stopped, per cent of good customers lost>
## 5. What the rule cannot see
<Who still passes, and why.>
## 6. How this could be wrong
<One way, and what would show it.>
## 7. Decision and sign-off
Decision needed: <what, from whom, by when>. Out of scope: <what this does not cover>.
Prepared <name, date>. Approved <name, date>. WORKED EXAMPLE
At a real lender a fraud analyst writes this and the head of fraud and risk signs it. At Owoleaf, Ashake writes it and Aramide signs. This one covers the book to the 28 October 2026 cut-off. Prepared by Ashake, 2 November 2026 (an assumed date).
Pattern. 25 devices and 25 phones are each used by 3 or 4 customers, forming 23 linked groups. Group 4 has six customers, nine applications and eight loans, and seven of those loans failed their first instalment. Two devices, a964 and 36b4, are joined by customer 18988.
Losses and accounts. The accounts in group 4 are 1189, 2231, 18988, 19156, 19233 and 19765. The proposed rule sends 65 loans to review; all 65 failed their first instalment, and ₦1,933,661.00 is outstanding on them. Losses and the label here are first-payment default, which overstates fraud: 142 of the book’s 310 first-payment defaults were fraud.
Proposed rule. An earlier link scores 60 points, so the application goes to a person before money moves, with the reason code linked_earlier.
Rates, against the key. At review, 65 of 65 reviewed loans were fraud, so none of the 65 was an honest customer. The whole rule set flags 26 of 35 account-farm loans, 74.3%, but 104 of 154 loans at step-up were not in the key. In the agent’s-phone test, 7 of 8 honest customers went to review.
Cannot see. The first application on each shared device: nine account-farm loans passed, each the first in its ring.
Could be wrong. The lab’s honest customers never share a device. A real family phone or agent tablet would show it, as a rising share of reviewed cases that pass.
Decision. Approve the review rung and an audited list of agent devices, by the next risk committee. Out of scope: stacking and collusion.
Now you
A month later you work for a salary-advance lender in Abuja, an unnamed company with a book like Owoleaf’s. The fraud lead has seen loan stacking pass the rules and wants a case review and a rule change. Use your own lab run. Step 4 shows that 3 or more enquiries in 7 days gives 74 loans and 54 first-payment defaults (73.0%), and 5 or more gives 35 loans and 34 defaults (97.1%). Step 7 shows 34 of 52 stackers flagged, and show_misses shows the 18 passed had 3 or 4 enquiries. Step 6 gives the cost inputs. Decide whether the threshold should fall, to which rung, and work out the false-positive rate yourself, saying which label you used. Your reader is the head of fraud, who signs, and the credit committee, which decides whether to accept more friction for honest shoppers.
Self-check
Aramide's team sees 310 of 8,386 applications fail the identity name check. Among the 158 that became loans, 59 failed their first instalment (37.3%, against 8.5% for the book). Customer support says many are honest: name order, spelling, a surname changed after marriage. Aramide must set the rule for a mismatch before next month's salary-advance campaign.
- DOC CBN: Revised Regulatory Framework for Bank Verification Number (BVN) Operations and Watch-List for the Nigerian Banking Industry (2021)
The base framework for the BVN system and its watch-list, from the regulator. Read how the watch-list works, what sanctions apply and what a listed person may not do. Press reports of 2026 changes are not this document: check the CBN's newer circulars separately.
- DOC Federal Reserve: Synthetic Identity Fraud Defined
The industry-recommended US definition the chapter quotes, with its reasoning. Read the definition and the note that it is guidance, not a rule. Skip the US-specific payment channels.
- DOC Federal Reserve: Synthetic Identity Fraud Mitigation Toolkit
A press release that points to a free toolkit for institutions on detecting and mitigating synthetic identities. Read it to see how the detection tools are grouped, then judge which fit a Nigerian lender's data.
- DOC ACFE: Occupational Fraud and Abuse Classification System (the Fraud Tree)
The standard map of fraud by employees, managers and executives: asset misappropriation, corruption and financial statement fraud. Read it as a checklist for insider and collusion controls. This is the 2022 edition; a newer report exists. Skip any case-frequency figures, which change by report year.
- DOC Credit Reporting Act 2017 (Nigeria)
The Act's text on a legal database. Read the parts on bureau licensing, data security and any fraud alert or blocking provisions, and check them yourself against the summary this chapter relies on.
- PAPER Appraisal of the Nigerian Credit Reporting Act 2017
An academic reading of the Act, in the Journal of African Law. Read it for how the Act treats fraud and what it leaves open. The full text may be behind the publisher's access. Read: The sections on fraud alerts, identity theft and the security of information.
- DOC Nigeria Data Protection Act 2023
A copy of the Act hosted by Nigeria's national CERT. Read section 37 on automated decision-making and the sections on the rights of a data subject, and compare it with this chapter's note before you cite a subsection.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.