How Purser decides what is safe to spend
Safe to spend is not a checking balance. Here is exactly how Purser works out the number, what it subtracts, and how it tells you when it is not sure.
The first number on Purser’s Today screen is safe to spend. It is the one we spent the most time on, because it is the one people act on. If it is too high, someone overspends. If it is too low, nobody trusts it. This post walks through how Purser works it out, in the same order the code does.
Why not just show the checking balance
Many money apps answer “what can I spend” with a bank balance, sometimes minus the bills due. That works if you pay for things from checking. Plenty of people do not.
Purser is built around a different pattern. Pay lands in one checking account. A few fixed transfers go out, to savings or investing. Nearly everything left is paid onto one credit card, and that card is what you spend from until the next payday.
In that pattern the checking balance tells you almost nothing. What you can actually spend is what that card payment bought, less what is already spoken for. So that is what Purser counts.
Two accounts with a job
For this to work Purser needs to know two things: which account your pay lands in, and which card you spend from. In the app these are roles you set on your accounts, called spending and spending card.
If no spending card is set, Purser does not guess. It falls back to the simpler number, checking minus the bills due, because without knowing which card you spend from that is the only honest answer it can give.
Step one: find the pay period
Everything is measured within a pay period, which runs from the day your pay lands through the day before the next expected payday.
Purser learns your paydays from history. It looks at deposits that look like payroll, preferring the ones that land in your spending account, and projects them backward and forward far enough to cover the longest pay cycle in use. When one source of pay follows a twice a month schedule, that source sets the period boundaries.
Other pay that lands before the next payday, such as a second earner’s paycheck, is shown as money coming in. It never moves the payday itself.
If no payday can be worked out at all, Purser measures from the first of the current month instead of measuring from nothing.
Step two: start from the card payment
The starting figure is what you paid onto your spending card during this period.
Bank feeds are imperfect, and one side of a payment sometimes arrives late or not at all. So Purser looks from both sides. On the card, a payment shows up as a credit. On checking, it shows up as a payment whose payee names the card’s own bank, so a payment to some other card never counts.
When a checking row and a card row have the same amount and post within three days of each other, they are one payment and are counted once. A payment seen on only one side still counts once on its own.
Step three: take away what is spoken for
Three things come off the card payment.
Your paydown goal. This is the amount you have decided to put toward paying the card down each period. It is yours to set, and Purser treats it as already spent.
What you have already charged. Purser adds up charges since the period started on the spending card and on every other personal card. Business cards and hidden accounts never count. A refund on a card takes back from what was charged, and anything you have marked to ignore is left out.
What is still due before payday. Purser walks your recurring bills and subscriptions forward from today through the day before payday, and keeps the ones that charge one of your personal cards. Transfers, income and card payments are not spending, so they are skipped.
A bill that has already posted this period is not counted twice. Purser looks for a charge on the same card within three days of the due date that is either linked to that recurring bill, or has the same payee and about the same amount, within five percent or a dollar, whichever is more.
Step four: the arithmetic
With those pieces the calculation is short:
Safe to spend is the card payment, minus your paydown goal, minus what is already charged, minus what is still due before payday.
The result never goes below zero. It is also never more than the credit still open on the card, which is the card’s limit minus its balance.
Step five: explain the number in plain words
Under the number, Purser says where it came from. The sentence is built from the same figures as the number, so the two always agree. A typical one reads:
From this period’s card payment, after your $300 paydown goal and $359 already spent
If charges are still due before payday, that part is added. If the card’s open credit is the real limit, the sentence says so instead: limited by the credit left on your card. And if you are already past this period’s budget, it says by how much, and shows what was spent against what payment and goal.
Step six: say when it is not sure
The hardest part of a number like this is the days when the data is incomplete. Purser has three rules for them.
Before the card payment lands. Early in a period, the payment may not have happened yet. Purser does not invent a number. It says it is waiting for this period’s card payment, and when it can, adds a best guess: the pay expected this period, less the fixed transfers it learned from the last period, less your paydown goal.
When the card’s transactions fall behind. Sometimes a bank keeps updating a card’s balance while the transactions stop arriving. If a card’s newest transaction is two or more days older than its latest balance, Purser treats the feed as lagging. It then also works out this period’s charges from how the card’s balance has moved since the period began, and uses whichever figure is larger. Overstating spending is safer than understating it.
When the card has not moved at all. If a card has sat at exactly the same balance since its last transaction, a day or more ago, that can mean nothing was bought, or it can mean the feed quietly stopped. Purser cannot tell which, so it adds a note: the card has not changed since that date, and charges since then are not counted yet.
What it never does
All of this is a set of small, pure calculations over balances, transactions and recurring items that Purser has already read. They are unit tested on their own, with no network and no cloud services involved.
None of it can move money. Purser reads your accounts and explains them, and every payment stays in your bank’s own app. Safe to spend is advice with its working shown, and the decision is always yours.