Merciven: revenue-leakage detection
A live SaaS that reads an SME's own spreadsheets and finds where money is leaking, with an AI layer that can't make up numbers.
- Organisation
- Merciven (own product)
- My role
- Founder and lead engineer
- When
- 2024 to present
- Stack
- React, Vite, Node.js, Express
Problem statement
Nigerian SMEs lose revenue to duplicate receipts, unapproved discounts and under-priced sales, but their records live in messy Excel sheets that no off-the-shelf tool understands.
Objectives & goals
- Work with the sheets owners already keep
- Explain findings in plain language
- Never show a figure the system didn't compute
- Charge for it with local payments
Process
- DiscoverCollected real spreadsheet layouts from SMEs and listed the leaks owners worried about.
- DefineTurned each leak into a detection method with the columns it needs.
- BuildColumn-role detection, detection methods, a grounded AI narrative, Paystack billing for two products.
- ProveA 37-fixture benchmark and 34 HTTP integration tests.
Who it's for
Wants to know how much is leaking and where, in naira.
Needs to trace every finding back to rows in the sheet.
Challenges
- Every business names its columns differently
- LLMs state confident numbers that aren't in the data
- Uploaded files can carry formulas or prompt-injection text
- Webhooks and stored tokens must be tamper-proof
What I built
Maps headers like "Receipt No" or "Disc %" to roles using synonyms and value shape.
Rejects any AI sentence whose figure isn't a computed result or whose citation doesn't exist.
Formulas neutralised; cell text never treated as instructions.
HMAC webhook verification, AES-256-GCM token encryption and an append-only audit log.
Flow
- Upload sheet
- Sanitise cells
- Detect column roles
- Run detection methods
- Compute findings
- AI explains
- Guard checks every figure
- Report
Output
Estimated leakage: ₦97,000 across 7 findings. Invoice INV-1003 recorded twice: ₦51,000 [F1] 25% discount above the 10% policy: ₦10,200 [F2] 25% discount above the 10% policy: ₦10,200 [F3] 15% discount above the 10% policy: ₦3,600 [F4] Sold below list price: ₦16,000 [F5] Sold below list price: ₦6,000 [F6] 2 invoice numbers missing from the sequence: ₦0 [F7]
Results
Tools & languages
The code
Detection methods, column-role detection, formula neutralising and the grounding guard in standard-library Python. 11 tests.
The repository is private. I'm happy to share it with a hiring team or walk you through it on a call.
Samples are written with synthetic data. No client code or client data is used.