LoonieCalc
Menu

Methodology

Last updated

Every calculator on LoonieCalc is built from primary Canadian government sources — the Canada Revenue Agency, the Office of the Superintendent of Financial Institutions, the Canada Mortgage and Housing Corporation, the Bank of Canada, Statistics Canada, Service Canada, and the relevant provincial finance ministries. We do not invent rates, do not estimate when a rule is published, and do not use third-party datasets when the primary source is itself accessible. This page documents the process.

Architecture: data files are authoritative

The site's calculators read every numeric input — every tax bracket, every contribution limit, every CMHC premium tier, every land transfer schedule — from versioned JSON files in the repository's data/ directory. Each data file lists the primary source URL, the date it was last verified, and the schema version of the file. Calculators import the relevant data file at build time and apply its values; they do not hardcode rates inline.

This separation has a strict implication: if a calculator and a data file disagree, the data file is correct. When we discover a rule change, we update the data file first, regenerate the build, and the calculator picks up the new values automatically. The reverse — updating a calculator without updating the data file — is treated as a bug.

How the math is built

Each calculator implements a published Canadian formula or schedule, not an opinion or model. The implementation steps:

  • Identify the authoritative formula in the primary source (a CRA payroll-deduction formula in T4127, an OSFI B-20 stress-test rule, a provincial LTT marginal schedule).
  • Reproduce the formula in TypeScript using decimal.js arbitrary-precision arithmetic where rounding matters (mortgages, payroll deductions, CMHC tiers). Native JavaScript number is used only where IEEE-754 floating point cannot cause off-by-one cents.
  • Cross-check the implementation against an authoritative public calculator (the relevant CRA tool, the Bank of Canada calculator, or a major bank's published calculator) using at least three test cases — including a low-income edge case, a mid-range typical case, and a high-income edge case.
  • Document the formula in plain English on the calculator page, in a "Formula" section, with a link to the primary source for each rate or limit it references.

Update cadence

Two triggers prompt a calculator review:

  • Quarterly review. Every calculator and its underlying data file is checked against its primary source once per calendar quarter (March, June, September, December), regardless of whether we are aware of any rule change. The "Last verified" date on the page is updated on every review, even if no values change.
  • Event-driven update. When the Bank of Canada changes its policy rate, OSFI publishes a B-20 amendment, the CRA announces indexation factors or limit changes, or a federal or provincial budget contains a measure that affects one of our calculators, we aim to ship the corresponding update within seven calendar days of the announcement. The data file's lastVerified date and the page's "Last updated" date are bumped together.

Verification process

Two automated gates run on every commit before a change reaches production:

  • pnpm validate:data — checks each data file in data/ against its declared JSON schema, confirms that every lastVerified date is present and parses as ISO 8601, and verifies that every primary-source URL listed in the file and in data/sources.json resolves over HTTP (returning 200 or 301; persistent 4xx or 5xx codes block the build).
  • pnpm lint:tone — scans every Astro template, Markdown file, TypeScript file, and JSON data file for a curated list of forbidden YMYL advisory phrases (directive "should" constructions, recommendation phrasing, "best choice" framing, and similar) and for AdSense-risky absolute claims. The full list and the gate itself are at scripts/lint-tone.mjs in the repository.

A separate weekly job (check-sources.yml) re-runs the URL health check across every primary source independent of code commits, so a source that goes 404 between commits is surfaced within seven days even when no calculator change is in flight.

Cross-corroboration

Where multiple sources publish the same rate (federal tax brackets, for example, are repeated in CRA tools, the Department of Finance budget documents, and provincial finance-ministry pages), each new value is confirmed against at least two independent sources before being committed. Where a single primary source is the only publisher (CMHC premium tiers, OSFI B-20 amendments), we wait for the source itself to publish before updating; we do not preempt with reporting from secondary outlets.

We treat the major Canadian secondary aggregators — Ratehub, WOWA, perchance.io, MoneySense — as cross-checks, not sources. We have observed instances of secondary aggregators carrying outdated provincial values (Alberta land transfer fees, in particular, has been misrepresented on at least one major aggregator more than 18 months after a relevant rule change). Where our values disagree with an aggregator's, we defer to the primary source.

AI assistance and human review

Initial drafts of calculator pages, written content, and the explanatory sections on this site are sometimes prepared with the help of large language models. Every figure, citation, and calculator implementation is reviewed against its primary source by a human before publication. We do not publish AI-generated content unverified, and we do not use AI to invent values that are not grounded in a published primary source.

Errors and corrections

When we identify or are notified of a calculation error or an out-of-date value, we (a) fix the calculator and the underlying data file within seven days, (b) update the "Last updated" date on the page, and (c) note any material correction in a footnote on the page for 90 days from the correction. To report a suspected error, email hello@looniecalc.ca with the page URL and what you believe is wrong. The full correction protocol is documented in editorial integrity.

Sources

The complete list of primary sources used across the site is at looniecalc.ca/sources, and each individual calculator page lists the specific subset of sources it relies on.