← Financial Ideas
Financial Ideas 2026-07-06

Cd Ladder Planner

A Python script that splits your savings across staggered-term CDs, projects interest per rung, and benchmarks the result against a HYSA and a traditional savings account — so you know exactly how…

Cd Ladder Planner

CD Ladder Planner

A Python script that splits your savings across staggered-term CDs, projects interest per rung, and benchmarks the result against a HYSA and a traditional savings account — so you know exactly how much you earn, when each CD matures, and what to do next.

Date: 2026-07-06 Type: Utility Theme: Saving Status: Idea

What it is

A command-line Python script that takes a total savings amount and a number of rungs (CD terms) and designs a CD ladder: an even split of your money across staggered maturities (e.g. 6-month, 1-year, 18-month, 2-year, 3-year). For each rung it computes the exact interest earned using daily-compounding math, then benchmarks the ladder's total return against what the same money would earn in a top high-yield savings account (HYSA) and a national-average traditional savings account. It closes with a reinvestment guide — what to do when each CD matures — and a provider shortlist sourced from publicly cited July 2026 rate tables.

Who it serves

Someone with $5,000–$50,000 in savings they won't need all at once but also don't want locked away indefinitely. They've heard about CD ladders but can't easily see the math without a spreadsheet. This script runs in 10 seconds and gives a clear, no-fluff answer: here is what you earn, here is when you can access each piece, here is your next step.

The money problem it addresses

Most people leave medium-term savings in a traditional bank savings account earning 0.38% APY — roughly one-tenth of what a competitive CD or HYSA pays. Even those who move to a HYSA often don't consider CDs because the math is opaque and locking money up feels risky. A CD ladder solves both problems: money becomes accessible on a rolling schedule (every 6 months in the default 5-rung plan), and each rung locks in today's rate so the user is protected if the Fed cuts rates and HYSA APYs fall. On a $10,000 balance over 36 months, the difference between a traditional savings account and this ladder is $561 in additional interest — while still having a rung mature every 6 months.

How it works

  1. Input: the user passes --amount (total savings), --rungs (number of CDs, default 5), and optionally --config (path to the rate-config JSON) and --start (first purchase date).
  2. Split: the script divides the total evenly across rungs; any leftover cent goes to rung 1.
  3. Projection: for each rung it applies the formula A = P × (1 + APY/365)^(365 × t) using decimal.Decimal (no binary-float rounding errors).
  4. Comparison: over the same horizon as the longest rung, it projects what the full principal would have earned in a top HYSA (4.10% APY, July 2026) and a national-average traditional savings account (0.38% APY).
  5. Reinvestment guide: prints what to do when each CD matures — default recommendation is to roll into a new longest-term CD unless funds are needed.
  6. Provider hints: lists the top-rated provider per term from the config (sourced from publicly cited rate tables; always verify before opening an account).

The script reads rates from sample-config.json. In production, the config's rates block would be populated by a live call to a rate-aggregation API; that call is stubbed and labeled # IN_PRODUCTION inside the script.

What's in this folder

  • README.md — this document
  • cover-image.png — cover illustration
  • metadata.md — automation sidecar
  • requirements.md — functional and non-functional spec
  • script.py — the CD ladder planner (Python 3.9+, stdlib only)
  • sample-config.json — illustrative rate config (5 CD terms + HYSA + traditional savings, rates sourced from July 2026 public data)
  • sample-output.txt — what a successful run prints for $10,000 across 5 rungs starting 2026-07-06

How to run / read it

# Default: $10,000 across 5 rungs using sample-config.json, starting today
python3 script.py --amount 10000

# Custom: $25,000 across 4 rungs, custom start date
python3 script.py --amount 25000 --rungs 4 --start 2026-08-01

# Point at a different rate config
python3 script.py --amount 15000 --config my-rates.json

Requires Python 3.9 or later. No third-party packages. See sample-output.txt for example output, and sample-config.json for the rate-config shape.

Estimated impact

On a $10,000 balance over 36 months, this plan earns $676 in CD interest vs. $115 in a traditional savings account — a $561 advantage. At $25,000, the same comparison yields a $1,403 advantage. The assumption is that CD rates hold steady (they are locked in at open) while the traditional savings account stays at the 2026 national average of 0.38% APY. Even in the current environment where top HYSAs match or slightly beat the ladder, the ladder provides rate-lock protection: if the Fed cuts rates and HYSAs drop from 4.10% to 3.00% during 2026–2027, a 3-year rung locked at 4.00% keeps earning regardless.

Good to know

This script is an educational organizer and projection tool — it is not personalized financial, investment, or savings advice. CD rates change daily; always verify current APYs directly with the provider or at Bankrate / NerdWallet before opening any account. The national-average savings rate (0.38%) is the FDIC figure as of mid-2026 and may drift. Early withdrawal from a CD typically incurs a penalty (often 90–180 days of interest depending on the bank); factor this in if there is any chance you will need the money before maturity. All sample data is synthetic; no real account numbers or personal details are used.

Sources

Requirements

Requirements — CD Ladder Planner

Purpose

Design and project a certificate-of-deposit (CD) ladder from a user-supplied total savings amount. Compare total interest earned against a high-yield savings account (HYSA) and a traditional savings account over the same horizon. Emit a plain-text schedule of maturities with reinvestment guidance.

Functional requirements

  • Accept total savings amount, number of rungs, and optional start date via CLI arguments.
  • Distribute the principal evenly across rungs (remaining cents go to the first rung).
  • Assign each rung to a CD term from the configured term list (e.g. 6-month, 12-month, 18-month, 24-month, 36-month).
  • Compute compound interest per rung using: A = P × (1 + APY/n)^(n×t), where n = 365 (daily compounding approximation).
  • Look up the APY for each term from the rates block in sample-config.json.
  • Compute a HYSA baseline (same total principal for the full ladder horizon at the configured HYSA APY).
  • Compute a traditional savings baseline (same principal, national-average APY of 0.38%).
  • Print a summary table: rung number, term, principal, APY, maturity date, interest earned, total at maturity.
  • Print a comparison block: ladder total interest vs. HYSA vs. traditional savings.
  • Print a reinvestment recommendation for each rung at maturity (roll into the longest configured term or describe the next-rung action).
  • Exit 0 on success; exit 1 on validation errors with a clear message to stderr.

Non-functional requirements

  • Python 3.9 or later; no third-party packages required.
  • All monetary math uses decimal.Decimal (never binary floats for currency).
  • Argument parsing via argparse.
  • Fully runnable against sample-config.json with no real accounts, logins, or API keys.
  • Stub block clearly labeled where a live rate-feed API call would go in production.

Inputs

Flag Type Default Description
--amount float required Total savings to ladder (e.g. 10000)
--rungs int 5 Number of CD rungs
--config path sample-config.json Path to rate-config JSON
--start YYYY-MM-DD today First CD purchase date

Outputs

  • Plain-text table printed to stdout (matches sample-output.txt).
  • Exit code 0 on success, 1 on error.

Constraints

  • No hard-coded secrets, tokens, or real account numbers anywhere in the script.
  • All sample data is synthetic; rates are from publicly cited sources (see README).
  • The script does not transmit data over the network.

More from Financial Ideas