← back to projects

pricing-engine

production

C++20 stochastic-volatility pricing & risk platform — Heston FFT calibration with AAD-accelerated Greeks, American Monte Carlo, a portfolio scenario engine, and live L2 ingest, every number validated against QuantLib across 225 tests.

C++20Heston FFTAADQuantLibReact

Overview

pricing-engine is a C++20 options pricing and risk platform: Heston Carr-Madan FFT calibration, AAD-accelerated Greeks, Longstaff-Schwartz American Monte Carlo, and a portfolio Greeks + scenario engine. Every number is validated against QuantLib. The C++ core is wrapped by a cpp-httplib JSON server and a React 18 UI, fed by live BTC options data (Binance L2 depth + Deribit option chains). The thesis is discipline: I validate, I don't trust.

Models

  • Heston — Carr-Madan FFT with the Little-Heston-Trap branch and Levenberg-Marquardt calibration.
  • AAD — a reverse-mode tape plus forward-mode duals (including complex-AAD for Heston) producing analytic Greeks instead of finite-difference bumps.
  • American Monte Carlo — Longstaff-Schwartz with a Laguerre basis and an Andersen-Broadie dual bound bracketing the true value.
  • Baselines — Black-Scholes (NEON-batched), CRR binomial, Crank-Nicolson / PSOR finite-difference, Sobol QMC, and Asian / barrier payoffs.

Validation

225 GoogleTest cases are parity-checked against QuantLib. The AAD Jacobian runs 2.30× faster than a numerical bump for the same Greeks, and the Longstaff-Schwartz price lands within ~4 bp of the PSOR finite-difference reference.

Measured Performance

  • Black-Scholes: 12.5 ns per option (NEON-batched hot path)
  • Heston Carr-Madan FFT: 333 µs/strike; full LM calibration of a 5×3 surface: 37.4 ms
  • Portfolio risk (100 positions × a 21×21 scenario grid): 1.37 ms
  • Sobol QMC: 7595× variance reduction vs pseudo-random Monte Carlo