✧ Inspiration

A layoff, a rent increase or a broken furnace can take us from living comfortably to barely making ends meet. Most people have no idea how long they would last in a scenario like that.

The Tangerine "Resilience Rewired" track asked a simple question:

How many months until the savings run out?

We wanted a multi-tool application that answers and visualizes that for anybody in seconds, along with lots of other useful features.


⇢ What it does

Bonker Banker calculates a customer's runway: how many months their savings last if something goes wrong.

$$ \text{Runway} = \frac{B - \text{one-off costs}}{S_{\text{after shock}} - I_{\text{after shock}}} \qquad \text{(capped at 120 months)} $$

where B is the savings buffer, S is typical monthly spending and I is typical monthly income.

▸ Know the customer

Pick any of the 4,500 accounts and see typical income, spending, fixed costs, savings buffer and runway, using the datathon's exact definitions. On top of that we add:

  • a 0 to 100 resilience score that explains every point it gives or takes away,
  • a comparison with people like them (same income band and age band),
  • a simulated runway that replays the account's own months 1,000 times to show the range of outcomes.

▸ Take a shock

The Shock Lab applies a job loss on EI, higher bills, a surprise repair, a rate hike, or any mix. The runway updates instantly, with the judges' formula worked through using the account's real numbers. A twist card typed in plain English ("they lose their job and bills go up 15%") is turned into shock settings automatically.

▸ Make a plan

An emergency-fund goal, a backup plan if the shock hits, and a ranked list of actions with the months of runway each one buys. A loan check tests whether a new loan is affordable at Bank of Canada rates, using standard amortization:

$$ P = \frac{A \, r}{1 - (1 + r)^{-n}} $$

where A is the loan amount, r is the monthly rate and n is the number of months.

▸ See the whole population

Every shock combination is run across all 4,500 accounts as a heatmap, broken down by age, household, region and income, plus a "who to call this week" list of the most at-risk customers with plain-English reasons.

▸ Bring your own data

Upload bank statement PDFs to get a spending breakdown and flags for unusual activity, then run the same analysis on your own numbers.


⚙ How we built it

Layer What we used
Stack Python and Flask on the backend; HTMX, Tailwind and ECharts on the front end. No build step.
Data The datathon CSVs are converted to Parquet once. A precompute script builds a profile for every account, and a vectorised stress test runs all 60 shock scenarios × 4,500 accounts in about a second.
Engine One engine implements the judges' definitions exactly. Every page, precomputed table and test is checked against it. For example, a test confirms the precomputed stress test equals the engine's runway account by account.
Statement parsing pdfplumber with layout-tolerant parsers, a keyword categorizer, and category priors learned from the dataset. The Gemini API is a fallback for unfamiliar statement layouts and interprets twist cards.
Outside data Bank of Canada lending and policy rates, and the 2026 EI maximum from the Government of Canada.

The optional realistic EI shock caps benefits at the 2026 maximum:

$$ I_{\text{EI}} = \min\left(0.55 \times I,\ \frac{\$729 \times 52}{12}\right) \approx \min(0.55\,I,\ \$3{,}159 \text{ per month}) $$


⚠ Challenges we ran into

Data leakage → Our first default analysis used each account's latest six months, which can come after the loan defaulted. We rebuilt it to score every borrower using only the months before their loan started. The result was weaker, but honest.

Matching the judges' numbers exactly → Every extra we added (true fixed costs, realistic EI, rate hikes) had to stay optional and clearly labelled, so the default numbers never drift from the official formula.

Messy PDFs → Real statements interleave sidebars, page footers and merchant names that wrap across lines. One bug quietly dropped merchants that appeared on more than one page.

Every bank also formats its statements differently, and a single general-purpose Python parser can't handle every layout. So we used Gemini to read the statements our rule-based parser couldn't:

  1. When the parsed transactions don't add up to the statement's printed balances, the text is sent to Gemini, with account numbers masked first.
  2. Gemini returns the transactions in a fixed format.
  3. We only keep its answer if the balances reconcile better than our parser's did.

Known banks get fast dedicated parsers, and any unfamiliar layout still works.

Surprising data → Many accounts record no household bills at all, so a "bills up 15%" twist barely moves them. We made the app explain that rather than look broken.

Keeping it fast and clear for a live demo → Heavy work is precomputed, and every page leads with one number, with the details behind expanders.


★ Accomplishments that we're proud of

↳ A real finding

Judged only on the months before the loan was granted:

Resilience grade Default rate
A 8.5%
F 47.1%

$$ \frac{47.1\%}{8.5\%} \approx 5.5\times \text{ as likely to default} $$

The score also separates defaulters better than runway alone: AUC 0.70 against 0.57.

↳ The population stress test

Scenario Accounts out of savings within 6 months
No shock (today) 2.7%
Job loss, EI at 55% 35.1%
Job loss + bills up 15% 38.7%

↳ An honest null result

Where someone banks barely predicts their resilience. How stable their income is predicts it strongly.

↳ Built for the live twist

Any account and any twist card runs in one click, with the formula shown step by step.


✎ What we learned

Averages can lie. One account in the dataset has a 7.8-month runway on paper, which sounds fine. But its income jumps around so much from month to month that when we simulated its future, about 1 in 10 runs had the money gone within a month. That changed how we thought about "safe".

Location mattered less than we thought. We expected it to matter a lot, since some districts have much higher unemployment. It barely did. What actually predicted who defaulted on a loan was how unstable someone's income was and how often they went into overdraft.

We got burned by our own data. Our first default analysis looked amazing, until we noticed we were using account activity from after the loan had already gone bad. Once we fixed it, the numbers got smaller, but we could actually trust them.

Agree on the hand-off first. Splitting the work went much better once we agreed on exactly what each piece would hand to the other before anyone started building. Before that, we kept stepping on each other's code.


⟶ What's next for Bonker Banker

  • Real Canadian data → connect to actual accounts through Canada's open-banking framework, so customers see their own runway rather than a sample.
  • Proactive alerts → notify a customer or advisor when the runway drops below a threshold or a risk signal appears, such as more overdraft days or bigger income swings.
  • Better-calibrated shocks → size shocks using Statistics Canada data on regional unemployment, rents and inflation, and model EI more precisely (benefit weeks, regional rules).
  • A validated risk model → build on the pre-loan finding with a properly tested default-risk model, and track how well the score predicts outcomes over time.

Built With

Share this project:

Updates

Submission history