1 unstable release
Uses new Rust 2024
| 0.1.0 | Jan 3, 2026 |
|---|
#191 in Simulation
9KB
retire 🏖️
Will your money outlive you? Find out in milliseconds.
A blazingly fast Monte Carlo retirement simulator. Run 10,000 simulations of your financial future using historical market data.
Features
- Fast: 10,000 simulations in under a second (parallelized with rayon)
- Accurate: Uses real historical returns (S&P 500, bonds, international stocks)
- Interactive: Beautiful TUI for exploring scenarios
- Professional: Generate PDF reports for yourself or clients
- Offline: Your financial data never leaves your machine
Installation
# With cargo (compiles from source)
cargo install retire
# With cargo-binstall (downloads pre-built binary)
cargo binstall retire
# Or download from GitHub Releases
# https://github.com/[username]/retire/releases
Quick Start
# Interactive mode - explore your retirement scenarios
retire
# Quick simulation
retire run --portfolio 500000 --age 35 --withdrawal 4%
# Generate a PDF report
retire report --output my-retirement-plan.pdf
Usage
Interactive TUI
Just run retire to launch the interactive interface:
┌─────────────────────────────────────────────────────────────┐
│ retire v0.1.0 │
│ Covers Your Assets • coversyourassets.com │
├─────────────────────────────────────────────────────────────┤
│ │
│ Portfolio: $500,000 Age: 35 Retirement: 65 │
│ Allocation: 80% stocks / 20% bonds │
│ Withdrawal: 4% ($20,000/year) │
│ │
│ ════════════════════════════════════════════════════════ │
│ SUCCESS RATE: 94.2% │
│ ════════════════════════════════════════════════════════ │
│ │
│ Median final value: $1,234,567 │
│ 10th percentile: $456,789 │
│ 90th percentile: $2,345,678 │
│ │
└─────────────────────────────────────────────────────────────┘
[↑↓] Adjust values [Tab] Next field [Enter] Run [q] Quit
Command Line
# Basic simulation
retire run --portfolio 500000 --age 35 --withdrawal 4%
# Custom allocation
retire run --portfolio 1000000 --allocation "70/30" --years 30
# Save a scenario for later
retire save "aggressive" --portfolio 500000 --allocation "90/10"
# Run a saved scenario
retire run --scenario aggressive
# Generate PDF report
retire report --scenario aggressive --output report.pdf
# View historical data
retire data --asset sp500 --years 50
Saved Scenarios
Scenarios are stored in ~/.config/retire/scenarios/ as JSON files. You can edit them directly or use the TUI.
{
"name": "conservative",
"portfolio": 500000,
"age": 35,
"retirement_age": 65,
"allocation": {
"us_stocks": 0.60,
"bonds": 0.40
},
"withdrawal_rate": 0.04
}
How It Works
Monte Carlo Simulation
Instead of assuming a fixed return rate (like 7%), we simulate thousands of possible futures by randomly sampling from historical returns.
- Sample historical returns - Pick random years from 1926-2024
- Simulate your portfolio - Apply returns, subtract withdrawals, repeat for 30+ years
- Count successes - How many simulations didn't run out of money?
- Report statistics - Median outcome, best case, worst case, success rate
Why Monte Carlo?
The market doesn't return 7% every year. Some years it's +30%, others it's -40%. The sequence of returns matters enormously - a crash early in retirement is devastating, while the same crash later is survivable.
Monte Carlo captures this randomness and gives you a probability of success, not a false certainty.
Historical Data
We use real returns from 1926-2024 for:
- US Large Cap Stocks (S&P 500)
- US Bonds (10-year Treasury)
- International Stocks
- Small Cap Value
- REITs
All returns are inflation-adjusted.
FAQ
Is this financial advice?
No. This tool is for educational and planning purposes only. Consult a qualified financial advisor for personalized advice.
Why not just use a spreadsheet?
Spreadsheets typically use a single average return rate. Real markets are volatile - Monte Carlo simulation captures the impact of market sequence risk that spreadsheets miss.
How accurate is this?
The simulation uses real historical data, but past performance doesn't guarantee future results. Use this as one input among many in your planning.
Can I trust my data is private?
Yes. All calculations happen locally on your machine. No data is ever sent anywhere. The tool works completely offline.
Contributing
Contributions welcome! Please read CONTRIBUTING.md first.
# Clone and build
git clone https://github.com/[username]/retire
cd retire
cargo build
# Run tests
cargo test
# Run with debug output
RUST_LOG=debug cargo run
License
MIT License - see LICENSE for details.
Acknowledgments
- Historical data from Aswath Damodaran
- Inspired by cFIREsim and FIRECalc
- Built with ratatui, rayon, and typst
Covers Your Assets • coversyourassets.com
⚠️ Not financial advice. Past performance does not guarantee future results.