How it works

The number is the product. If the math is wrong, nothing else matters. This page walks through how it's computed, where the data comes from, and what assumptions to keep in mind.

1 · The big picture

You tell us a recurring spend (e.g. $5/day on coffee) and an asset (e.g. the S&P 500). We pretend you'd invested that money in the asset on every period since some start date. The headline number is what the position would be worth today, in your currency. Everything runs in your browser — the math, the chart, the comparables — against small precomputed price files we ship with each release.

2 · The core math

For each cadence period (daily / weekly / monthly), we buy $1 worth of the asset at that period's close price. So shares purchased = 1 / price[t]. Accumulate across the window: cumulative shares × current price × your dollar amount = your portfolio value. The amount you typed is a pure multiplier; the math doesn't change shape when you change the number. Every period is deterministic — no randomness, no projection.

3 · Trading days vs calendar days

The market is open ~252 days a year, not 365. So the default daily cadence buys 252 times a year. Toggling 'weekends too' on the daily-cadence row treats the input as calendar-daily — weekend + holiday spend gets pooled onto the next trading day's open. The math approximates this as ``shares[month] × (calendar_days / trading_days_observed)`` per month — accurate to <0.5% over multi-year windows.

4 · Dividends (DRIP)

Default ON. Every dividend the asset paid gets automatically reinvested into more shares of the same asset, at that day's close. The chart's overlay (toggle 'show on chart' in the DIVIDENDS row) shows the gap between the with-dividends path and the price-only path — that gap IS the dividend contribution. For high-yield assets over decades, this is often more than half the final value.

5 · Inflation (CPI)

Default off (constant nominal). When on (discount mode), each historical month's input is scaled by CPI[then] / CPI[today] — so $5/day today is $3.65/day in 2010 nominal dollars. The calc still uses the asset's actual historical prices; only the input is rescaled to reflect what would have been spent in then-current dollars. Data is BLS CPI-U (1982-84 = 100 base); non-US locales currently fall back to US CPI.

6 · Regional pricing (US)

When the locale is set to US, the suggested habit amount can be refined by state or metro via BEA Regional Price Parities. A NYC coffee suggests ~$7.50; a Tulsa one ~$5. Multipliers are shown next to each option (RPP / 100). This is only a suggested-input refinement — the math doesn't compound regional drift across time (assumes today's RPP gap is roughly stable over the window).

7 · Display currency

The top-nav currency picker shows the receipt's numbers in any of 12 major currencies, decoupled from your locale. Today the cross-currency display uses a single static spot rate snapshot — accurate to typical FX volatility (±5-15%). The 'approximate FX' footnote flags this whenever display currency ≠ asset's source currency. Year-aware historical FX is on the roadmap.

8 · Data sources

Prices: Yahoo Finance (adjusted close). Company names: Yahoo's v1/search canonical longname. HQ + websites: Wikipedia infoboxes, with Wikidata's structured P159 / P856 / P625 as a fallback for international names. Coordinates: GeoNames. Asset universe: S&P 500 + the full Vanguard Total World ETF (~9,000 tickers) + a curated top-100 ETF set + crypto + commodities. All collected at build time into a Postgres database; the browser never talks to the source.

9 · How often is data refreshed?

Prices refresh daily via a scheduled scrape (Mac cluster, polite throttling, browser-fingerprinted requests so Yahoo doesn't deprioritise us). HQ + sector data refresh weekly. CPI + FX tables refresh on each release. The header of each dataset file includes the publish date — visible in the freshness stamp under the chart.

10 · This is not financial advice

ifyouspent is an illustration. It shows what historical prices would have done given a hypothetical spending pattern — it doesn't recommend you buy anything, doesn't model tax, doesn't account for trading costs, and doesn't know your situation. Past performance doesn't predict future returns. The biggest drawdowns are NOT visible on the chart — averaging hides the bad months. If you'd invested through 2008 you'd have watched the position halve in 18 months. Treat every number as a backward-looking 'what if' and consult a real fiduciary before making any actual decision.