monte_carlo_portfolio
Pure-compute Monte Carlo portfolio simulation using Geometric Brownian Motion (GBM). Models a multi-asset portfolio across time with contributions, withdrawals, and annual rebalancing. Returns full probability distribution of terminal wealth, percentile paths, drawdown stats, and Sharpe ratio. Modes: simulate (full Monte Carlo) | glide_path (lifecycle 110-age target-date allocation) | stress_test (4 historical crises: 2008 GFC / 2000 dotcom / 1970s stagflation / 2020 COVID). No external data needed — all computed from asset assumptions. Ticker defaults built-in: SPY/VOO/VTI 7%/15%, QQQ 9%/20%, TLT/BND 3%/6%, GLD 5%/18%, BTC 30%/70%. ICP: asset managers, family offices, retail wealth advisors, robo-advisor agents, retirement planners. 10k simulations × 30 years runs in <3s on V8 JIT.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | simulate = full Monte Carlo GBM | glide_path = lifecycle target-date allocation | stress_test = 4 historical crisis scenarios | |
| async | No | If true, returns a job_id immediately (<200ms) instead of waiting for the result. Poll the result with job_result(job_id). Use for slow tools to avoid client timeouts. | |
| assets | Yes | Portfolio assets. Weights must sum to 1.0 (auto-normalized if not). | |
| simulations | No | Number of Monte Carlo simulations (1000-100000). Default 10000. | |
| horizon_years | Yes | Investment horizon in years (1-50). | |
| target_value_eur | No | Target terminal portfolio value in EUR. Used to compute probability_target_achieved. | |
| confidence_intervals | No | Percentiles to compute in the output distribution. Default [5, 25, 50, 75, 95]. | |
| initial_investment_eur | Yes | Initial capital in EUR (e.g. 100000 for €100k). | |
| withdrawals_annual_eur | No | Annual withdrawal amount in EUR for decumulation phase (e.g. 50000 for €50k/yr). | |
| contributions_annual_eur | No | Annual contribution in EUR (e.g. 12000 for €1000/month). |