This application is a financial simulation tool designed for individuals planning for early retirement (FIRE) in Switzerland.
Phase 1 focuses on the post-retirement decumulation phase for a single individual with no dependents living in Canton Zurich.
- Dual Emulation Modes: Compare outcomes using both Historic Returns (using ~100 years of historical S&P 500 and proxy data) and Monte Carlo Simulations side-by-side.
- Swiss Tax Modeling: Accurately models Federal, Cantonal, and Municipal income and wealth taxes for Canton Zurich.
- AHV for Non-Workers: Models mandatory AHV contributions for early retirees before age 65.
- Pillar 2 & 3a Liquidations: Simulates growth and staggered lump-sum withdrawals of Pillar 3a accounts (up to 5) and Pillar 2 vesting accounts, including capital withdrawal taxes.
- Smart Cash Buffer: Optional defensive strategy to spend cash first during market downturns, protecting equities.
- Dynamic Expenses: Optional adjustment to reduce expenses when net worth drops below the starting watermark.
- Configurable Success Criteria: Set target ending net worth (e.g., preserve 50% of inflation-adjusted starting wealth) and calculate probability of success.
├── app.py # Streamlit frontend UI
├── src/
│ ├── simulation_engine.py # Core decumulation simulation loop
│ ├── tax_engine.py # Swiss/Zurich tax calculations
│ └── historic_returns.py # Historic return data and generators
├── docs/
│ ├── prd_early_retirement_calc.md # Product Requirement Document
│ └── design_doc_early_retirement.md # Technical Design Document
├── requirements.txt # Python dependencies
└── venv/ # Python virtual environment (ignored by git)
- Python 3.11+
- Virtual environment tool (
venv)
-
Clone the repository (once created on GitHub):
git clone git@github.com:b-maldoca/fi.git cd fi
-
Set up the virtual environment and install dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
Start the Streamlit app:
streamlit run app.pyThe app will open in your default browser, typically at http://localhost:8501.