Inspiration
A layoff, a rent hike or a broken furnace can turn a "fine" budget into a crisis in weeks, and most people have no idea how many months their savings would actually last. Tangerine's Resilience Rewired challenge asked us to answer that for real bank customers. Exploring the data, we kept finding customers who looked completely safe on a normal month but would run out of money fast after a shock. We wanted to build something that shows that gap, the "delta", before it's too late, and tells each person what would close it.
What it does
Delta-or-Die is a financial resilience engine for real, anonymized bank customers. You type an account and a "what if" in plain words, such as a layoff on EI, higher bills or a surprise repair. The app shows what it understood as editable sliders, then three runways (how many months savings last): today, after the shock, and after a personal plan. It sorts every customer into one of four types, then finds the spending cuts that stretch their savings furthest, using only cash withdrawals, household bills and other transfers out, with one line of advice for that customer's type. It also shows an emergency-fund plan, a labelled view with the real EI cap, and the same twist run on all 4,500 customers: a globe of dots where everyone who falls short of the goal turns grey. Follow-up questions build on the last twist. Every number comes from code, and the whole app runs offline
How we built it
- Python, pandas and numpy for the engine. We load the monthly summaries once and build one row per customer with the challenge's official definitions for income, spending, bills and savings.
- Customer types: four rules, first match wins: Stabilize first, Pension-protected, Savings-first and Trim.
- Optimizer: a brute-force search that tries every combination of cuts (in 5% steps) on three spending levers, with limits that depend on the customer's type. It's vectorized, so it runs on all 4,500 customers at once in under a tenth of a second.
- AI translator (Anthropic API, Claude Haiku): reads the judge's twist in plain words and returns only the settings it mentions as structured JSON. The model never calculates; our code does every number. If the API fails or takes more than 8 seconds, the backup parser takes over.
- Backup twist parser: keyword rules that turn twists like "laid off, EI at 55%, bills up 15%" into settings, tested on 34 phrasings. Follow-up questions only change what they mention.
- Screen: a small local web server built with Python's standard library, serving an HTML page with sliders, the three runways and an interactive globe of every customer. No installs beyond pandas and numpy; it works offline with the backup parser.
- Teamwork: each of us owned specific files on our own branch, with tests for every module and pull requests merged in a set order.
Challenges we ran into
- Matching the official numbers exactly. Judges pre-computed answers with the challenge formulas, so every runway had to match to one decimal, including edge cases like zero income, no savings, or income that fully covers spending.
- One answer, two ways. The single-customer view and the "everyone" view had to give identical results for all 4,500 accounts, so we built the single version on top of the bulk one and tested every account.
- Most spending is invisible. 76% of spending is cash withdrawals, so we couldn't tell people to "eat out less". We phrase every cut as a lever the bank can actually see.
- The official EI rule vs. reality. The challenge assumes EI pays 55% of income, but real EI has a weekly maximum. We kept the official number as the main answer and added the real cap as a clearly labelled second view.
- An idea that didn't work. We tried learning what people cut when their income drops, but in this data spending falls to zero along with income, so we dropped it rather than force a result.
- A first datathon on almost no sleep. Coordinating three people, six branches and a dozen merges overnight taught us a lot about clear ownership.
Accomplishments that we're proud of
- Our headline finding: all 27 borrowers who went below zero before taking a loan defaulted, while none of the 606 who repaid ever went below zero.
- A plan that works: after a layoff, the share of customers who can't last 6 months drops from 35% to 6.5% with our cuts.
- Exact matches with the challenge's official runways, backed by tests across every module.
- Speed and reliability: the whole bank's customers in under a tenth of a second, fully offline.
- A globe that makes risk visible: you can watch customers sink as a shock gets bigger.
What we learned
- Looking safe isn't being resilient. 74% of customers earn more than they spend, yet 1 in 5 of them couldn't survive 6 months of a layoff. A monthly surplus says nothing about the size of the cushion behind it.
- One size doesn't fit all. A customer who keeps going into overdraft needs a different plan from a pensioner, which is why types matter.
- Simple, honest methods win. Brute force was fast enough, easy to explain to judges, and impossible to get "lucky" with.
- Small samples deserve caution. Our overdraft finding is striking, but 27 borrowers is a signal, not a proven rule, and we say so.
- Git, branches and pull requests for a three-person team on a deadline.
What's next for Delta-or-Die
- Deeper personalization: let customers set their own limits ("I can't cut my bills, but I can cut cash"), learn which cuts each person actually sticks to, and turn the one-line advice into a full step-by-step plan for each customer type.
- A tracking feature: monthly check-ins that follow each customer's runway over time, show progress toward their emergency fund, and celebrate when they hit a milestone.
- Early warnings: alert customers, and the bank, the moment an account starts going below zero, since that was the strongest warning sign of default in our data.
- More realistic shocks: the real EI rules (weekly maximum, waiting period, number of weeks), province-specific costs, and combined shocks over time.
- An AI assistant that understands any phrasing of a "what if", with our keyword parser kept as an offline backup.
- Bringing it to Tangerine: a version built into online banking, so customers can check their own resilience in seconds.
Built With
- anthropic
- claude
- css3
- git
- github
- google-fonts
- html5
- http.server
- javascript
- json
- numpy
- pandas
- python
- rest-api
- visual-studio