The book *Quantitative Finance with OCaml* presents itself as a comprehensive guide to building correct, performant, and maintainable financial systems using OCaml. It teaches quantitative finance through the lens of OCaml, covering topics such as pricing derivatives, managing risk, modeling credit, building trading algorithms, and designing robust financial infrastructure. A central claim is that OCaml’s type system makes whole classes of financial programming errors impossible at compile time, thereby increasing correctness without sacrificing performance. The authors state that every concept is accompanied by production‑quality OCaml code and that mathematical derivations are presented honestly, not buried in appendices. They also emphasize building reusable, well‑typed libraries that accumulate across chapters, treating performance and correctness as equal concerns. The book’s coverage extends to modern OCaml 5 features, including domains, effects, and OxCaml extensions. Structurally, the work is organized into seven parts that can be read sequentially or used as a reference. Part I covers foundations (OCaml essentials, mathematics, probability). Part II addresses fixed income and interest rates (bonds, yield curves, rate derivatives). Part III deals with equity and derivatives (Black‑Scholes framework, numerical methods, Monte Carlo, volatility, exotic options). Part IV focuses on credit and multi‑asset models (credit risk, portfolio credit derivatives, multi‑asset correlation). Part V concerns risk management (market risk, Greeks, XVA, portfolio optimization). Part VI covers algorithmic trading and market microstructure (market microstructure, execution algorithms, quantitative trading strategies, high‑performance trading infrastructure). Part VII explores advanced topics (stochastic calculus and advanced pricing, machine learning in quantitative finance, regulatory and accounting frameworks, systems design for quant finance, and a capstone project for a complete trading system). Each chapter directory contains a README.md with chapter text, a lib/ directory for reusable library modules, examples/ with worked examples, exercises/ for practice problems, and benchmarks/ for performance experiments. To build the examples, readers are instructed to install dependencies via Opam (core, owl, zarith, menhir, ppx_deriving), then use Dune to build and test the code. The book adopts a clear notation: OCaml code appears in syntax‑highlighted blocks, mathematical formulas use standard LaTeX‑like notation (e.g., $S_t$ for asset price at time $t$, ${color{red}}$sigma{color{reset}}$ for volatility, $r$ for the risk‑free rate), OCaml types are shown in OCaml notation (e.g., float -> float -> float), and module paths are written as Module.function (e.g., Black_scholes.price). The current version is 1.0, released in February 2026, with corrections and contributions welcomed via the project repository. As an illustration of the book’s depth, Chapter 11 — Numerical Methods for Option Pricing — discusses lattice methods (binomial and trinomial trees) and finite difference schemes for the Black‑Scholes PDE, explains the CFL stability condition, quantifies convergence rates, and shows how Richardson extrapolation can improve accuracy. The chapter includes concrete OCaml implementations of Cox‑Ross‑Rubinstein binomial trees, early‑exercise handling for American options, and Greek calculations via tree bumping. This example demonstrates the book’s blend of mathematical rigor, practical code, and performance analysis. All factual statements above are drawn directly from the supplied primary source (https://qcaml.com/index.html) and the supporting primary source for Chapter 11 (https://qcaml.com/part-3-equity-derivatives/ch11-numerical-methods/).
HN Digest / · HN #49930690
Quantitative Finance with OCaml: A Type‑Safe Guide to Financial Engineering
The book *Quantitative Finance with OCaml* teaches core quantitative finance topics—derivative pricing, risk management, credit modeling, and algorithmic trading—using OCaml’s strong type system to eliminate entire classes of financial programming errors at compile time. It provides production‑quality code, honest mathematical derivations, and covers modern OCaml 5 features across seven parts and 31 chapters.

Screenshot of the source page (qcaml.com)
Sources
- Introduction - Quantitative Finance with OCaml
- Chapter 11 — Numerical Methods for Option Pricing - Quantitative Finance with OCaml