← Charlie Yan

pricers

2026 — Python · numpy · QuantLib

Repository ↗

Independent implementations of the pricing methods a quant-dev screen asks for. Black-Scholes with Greeks and implied vol. CRR, Jarrow-Rudd and trinomial trees. Explicit, implicit and Crank-Nicolson finite differences, with PSOR and Brennan-Schwartz for American exercise. Monte Carlo with antithetic and control variates. Longstaff-Schwartz. The COS method for Heston.

QuantLib already does all of this, faster. The point is the verification harness.

The one rule

No number is quoted without the oracle it was checked against and the tolerance it met. Each method is validated against a closed form, a published value, or QuantLib. Convergence rates are tested, not just convergence. The accuracy-versus-speed table is regenerated by pricers bench in CI, with the machine named in the header.

76 tests: identities to 1e-10, oracles at stated tolerances, convergence rates, and four QuantLib cross-checks that skip cleanly when QuantLib isn’t installed.