Pricing Engine
Summary
A research-grade framework that prices European options under a two-sided Hawkes jump-diffusion model, calibrated against live market data.
The Problem
Standard option pricing models assume jumps arrive independently, but real markets show clustering: a big move tends to be followed by more moves. Capturing this requires a richer stochastic model, and calibrating such a model from market data is mathematically challenging and computationally expensive.
The Solution
I was responsible for the entire programming implementation of this project: a from-scratch, research-grade Python framework for pricing European options under a two-sided Hawkes jump-diffusion model, where upward and downward jumps self- and cross-excite one another with mean-reverting intensities.
Key features:
- Market data pipeline: asynchronously pulls price bars from Interactive Brokers into PostgreSQL and computes log-returns with intraday/overnight splitting
- Jump filtering: statistically decomposes log-returns into a continuous diffusion component and discrete positive/negative jumps, validated with Jarque-Bera and Kolmogorov-Smirnov tests
- Custom differential evolution optimizer with multiprocessing for global search over the rugged likelihood surface, then L-BFGS-B gradient refinement with standard errors from a numerical Hessian
- Mathematical core: solves Riccati ODE systems for the affine characteristic function under both the physical P and risk-neutral Q measures via scipy solve_ivp
- COS method pricing using the characteristic function, with adaptive truncation bounds from conditional moments
- Risk-neutral calibration that transforms P-measure parameters to Q-measure via a Radon-Nikodym density and fits risk premia to the market implied-volatility surface
Key takeaways:
- Implemented numerical optimization, statistical inference, and stochastic modelling from scratch rather than wrapping existing libraries
- Wrote a Numba JIT-compiled Ogata thinning sampler to simulate the bivariate marked Hawkes process for validation
- Learned to move a research algorithm into a production-grade codebase with typed settings, structured logging, Docker Compose infrastructure, and CI/CD with tests and coverage