Finance lab
Models from corporate finance and investments, built to play with. Everything runs in plain JavaScript in your browser, with no libraries.
CAPM and the security market line
Required return = risk-free rate + beta × market risk premium.
Discounted cash flow valuation
Five years of growing free cash flow plus a Gordon growth terminal value, discounted at the WACC.
Sensitivity: enterprise value (m)
Rows are terminal growth, columns are WACC. The outlined cell is your base case.
Portfolio optimizer
Markowitz mean-variance optimization for three assets. The curve is the efficient frontier, the dots are 1,400 random long-only portfolios colored by Sharpe ratio, from lavender (low) to pink (high).
Monte Carlo simulation
Thousands of possible futures for a portfolio, simulated month by month with geometric Brownian motion. Shows the range of outcomes, the chance of losing money and the 95% Value at Risk.
Option pricing with Black–Scholes
The price of a European option and its Greeks: how the price reacts to the stock (delta, gamma), volatility (vega), time (theta, per day) and interest rates (rho).
Put–call parity check: .
Bond pricing, duration and convexity
Price a bond with face value 1,000, and see why duration alone underestimates the price when yields move: the price–yield curve is convex.