Pricing Functions¶
All pricing functions are pure functions with no side effects. They take an instrument and market data, and return a scalar price.
Analytical¶
black_scholes_price¶
Black-Scholes-Merton closed-form for European options on equities.
black76_price¶
Black-76 for European options on forwards/futures.
bachelier_price¶
Bachelier (normal) model. vol is absolute (normal) volatility.
black_scholes_implied_vol¶
black_scholes_implied_vol(option, spot, rate, dividend, market_price,
n_iterations=20) -> Float[Array, ""]
Newton-Raphson implied volatility using autodiff vega.
Bond Pricing¶
zero_coupon_bond_price¶
Price a zero-coupon bond from a discount curve. Returns face_value * DF(maturity).
fixed_rate_bond_price¶
Price a fixed-rate coupon bond by discounting each future coupon and the face value redemption using the curve.
fixed_rate_bond_price_from_yield¶
Standard yield-based bond pricing: \(P = \sum_i \frac{C}{(1+y/f)^i} + \frac{F}{(1+y/f)^n}\).
yield_to_maturity¶
Newton-Raphson YTM solver using autodiff for the price-yield derivative.
modified_duration¶
\(-\frac{1}{P}\frac{dP}{dy}\) computed via jax.grad.
convexity¶
\(\frac{1}{P}\frac{d^2P}{dy^2}\) computed via nested jax.grad.
key_rate_durations¶
Sensitivity of bond price to each curve pillar's zero rate. One backward pass gives all sensitivities.
Monte Carlo¶
mc_price¶
Monte Carlo pricing. Dispatches path generation based on model type (BlackScholesModel or HestonModel).
mc_price_with_stderr¶
Same as mc_price but also returns the standard error estimate.
MCConfig¶
PDE¶
pde_price¶
Crank-Nicolson finite difference solver in log-spot space.
PDEConfig¶
Lattice¶
binomial_price¶
CRR binomial tree. Supports both European and American exercise.