This book defines, precisely and mathematically, everything the QuantX library computes. It is written to be read without any programming background: every quantity is defined before it is used, every market convention is stated explicitly, and every formula is explained in words and illustrated by a worked example.
The book is the reference for the library, not a description of it. When the code and this book disagree, the disagreement is a defect to be fixed.
How to read this book
- Chapters cover one topic each and build on the previous ones. Each opens with a notation table listing every symbol it introduces.
- Numbering. Sections are numbered per chapter (§1.4 is section 4 of chapter 1), and so are equations (eq. (1.5) is the fifth numbered equation of chapter 1). The code and the tests cite these numbers, so any result can be traced from the code to its definition here and back.
- Edge cases (holidays, month ends, leap years, fixings already known, negative rates) are stated where they arise, never left implicit.
- Worked examples close each chapter, with numbers that the test suite checks.
General conventions
| Notation | Meaning |
|---|---|
2026-10-10 |
A date, written in ISO 8601 form (year-month-day) |
| \(\lfloor x \rfloor\) | \(x\) rounded down to an integer (towards \(-\infty\)) |
| \(a \mathbin{\mathrm{mod}} b\) | Remainder of \(a\) divided by \(b\), between \(0\) and \(b - 1\) |
| \(\min\{a, b\}\) | The smaller of \(a\) and \(b\) |
| \([a, b]\), \([a, b)\) | Intervals including both ends; including \(a\) but not \(b\) |
| \(x \mid y\) | \(x\) divides \(y\) exactly |
Interest rates and year fractions are plain numbers (0.05 means 5%), unless a chapter states otherwise. Every amount carries its currency, and is signed for the holder: received positive, paid negative (Section 8.3).
Chapters
- Dates, tenors and frequencies (Chapter 1)
- Holiday calendars and business days (Chapter 2)
- Day count fractions (Chapter 3)
- Schedules (Chapter 4)
- Numerical foundations (Chapter 5)
- Overnight indices and OIS (Chapter 6)
- Discount curves (Chapter 7)
- Currencies, amounts and FX rates (Chapter 8)
- Equity options (Chapter 9)
- Term rates, swaps of any legs and FRAs (Chapter 10)
- Multi-curve calibration (Chapter 11)
- FX forwards and cross-currency swaps (Chapter 12)
- Interest rate options (Chapter 13)
- EUR, GBP and JPY curves (Chapter 14)
- Building a market (Chapter 15)
- Exposure and CVA (Chapter 16)
- Historical statistics (Chapter 17)
- Credit default swaps and survival curves (Chapter 18)
- Fixed-rate bonds and Sukuk (Chapter 19)
- Portfolio valuation and risk (Chapter 20)
- Loans (Chapter 21)
New chapters are added as the library grows.