quantfinlib
A Java library for quantitative finance research and risk, using only the JDK at runtime, with a reference low-latency trading lane.
What it covers
| Area | Packages | Examples |
|---|---|---|
| Pricing | pricing, fx | Black-Scholes-Merton, Black-76, Bachelier, implied volatility, Heston (COS, calibration), SABR, SVI and SSVI, Dupire local volatility, barriers, touches, Asian, quanto, vanna-volga, FX volatility surface |
| Rates and credit | rates, credit | Multi-curve OIS bootstrap with DV01, street-convention bonds, swaps, swaptions, caps, day counts, ISDA CDS model with holiday calendars and the swap-only ISDA rate curve, single- and multi-currency exposure simulation with foreign-currency swaps and a stochastic basis, CVA, bilateral and wrong-way CVA, Z-spread |
| Market risk | risk, volatility, crb | VaR and Acerbi-Tasche ES, filtered historical simulation, EVT, stress tests, VaR backtests, FRTB-style ES, FRTB standardised approach, SA-CCR with haircuts, factor risk model, GARCH by maximum likelihood, central risk book |
| Portfolio and research | optimization, alpha, backtest | Active-set QP optimiser, risk parity, Black-Litterman, factor IC with Newey-West errors, alpha combination and attribution, capacity curves, next-open backtests, corporate events, walk-forward, deflated Sharpe |
| Execution | microstructure, execution | Almgren-Chriss, impact and queue models, VWAP/TWAP/POV/IS algorithms, smart order routing |
| Trading lane (reference) | marketdata, trading, orderbook, fix, sbe, feed | Ring buffers, risk gate with kill switch, order state machine with cancel/replace, matching engine, call auctions, position ledger fed from gateway fills with busts and corrections, versioned limits, FIX 4.2/4.4/5.0 SP2 sessions and hot-path encoder with journal, schedules and repeating groups, SBE schema 2, ITCH 5.0 |
| Controls and reporting (reference) | entitlements, regreporting | Deny-overrides entitlements with an audit log and a pre-trade check, MiFIR RTS 22 transaction reports with auth.016 output and ESMA rules, GLEIF, FIRDS and ISO 10383 lookups, CAT and EMIR Refit reports (not certified) |
Install
From JitPack:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<!-- stable tier only -->
<dependency>
<groupId>com.github.AshJha0.Quant-Finance-Library</groupId>
<artifactId>quant-finance-library</artifactId>
<version>v4.0.0</version>
</dependency>
<!-- or the trading lane, which brings the stable tier with it -->
<dependency>
<groupId>com.github.AshJha0.Quant-Finance-Library</groupId>
<artifactId>quant-finance-library-lowlatency</artifactId>
<version>v4.0.0</version>
</dependency>
<!-- optional: CSV and HTTP loaders (quant-finance-library-io), or the incubating
strategy DSL (quant-finance-library-research); same groupId and version -->
Or build from source with a JDK 25:
git clone https://github.com/AshJha0/Quant-Finance-Library.git
cd Quant-Finance-Library
./mvnw verify
Documentation
- Getting startedBuild, first backtest, paper trading, benchmarks
- API referenceJavadoc for every package
- ArchitecturePackage map, data flow, design rules
- LearnTutorial from first principles, with exercises
- CookbookRunnable recipes
- DiagramsMermaid diagrams of the main flows
- Market riskThe risk workflow mapped to classes
- Central risk bookNetting, internalisation, hedging
- Trading laneOrder lifecycle, risk gate, protocols, tuning
- BenchmarksMethod and results
- StabilityStable APIs and versioning policy
- Migrating to 4.0Every 4.0 removal and move, with the dependency to add
- Migrating to 3.1The 3.1 deprecations and their replacements
- Design for 4.0The 4.0 module split and why some packages stayed in core
- Migrating to 3.0What 3.0 removes or moves, and the 2.4 replacement
- Migrating to 2.4Deprecations and new opt-in behaviour in 2.4
- Migrating to 2.3Removed SIMM package and the result changes in 2.3
- Migrating to 2.2Two default changes and how to keep 2.1 behaviour
- Migrating to 2.1New APIs and behaviour notes
- Migrating to 2.0Breaking changes from 1.x
- ChangelogRelease history
Not implemented
- ISDA SIMM: not included; ISDA licenses SIMM for use
- FRTB SA certification; SEC-IRBA weights in the securitisation default risk charge
- SA-CCR haircuts for funds (CRE22.50 fund rule)
- Stochastic basis for foreign-currency swaps
- Certification of the CAT and EMIR reports; MiFIR rules CON-330, CON-331 and CON-430 and the pending workflow
- Live venue connectivity and certification