A European options pricing engine based on the Black-Scholes model, written in modern C++17 to production-code standards: a clean architecture, a reproducible build, and a test suite that checks the maths rather than just the code paths.
EuropeanOption call{100, 1.0, OptionType::Call}; // strike, maturity, type
MarketData market{100, 0.2, 0.05}; // spot, volatility, rate
pricing::PricingResult res = pricing::price(call, market);
// res.price ≈ 10.4506, plus res.delta, res.gamma, res.vega, res.theta, res.rho
import pricing
res = pricing.price(pricing.EuropeanOption(100, 1.0, pricing.OptionType.Call),
pricing.MarketData(100, 0.2, 0.05))
print(res.price, res.delta, res.gamma)
EuropeanOption,
MarketData and the pricer are independent. New pricing engines (e.g. Monte Carlo) can
be added without touching the instrument or market code.NaN from
log(S/K)/(σ√T).std::erf-based normal CDF.FetchContent.C − P = S − K·e−rT checked across ATM,
ITM, OTM, high-vol, short-maturity and zero-rate scenarios.NaN.Model assumptions: constant volatility and interest rate, no dividends, European exercise only.