QuantLib
Open-source library for derivatives pricing and quantitative finance.
Features
Derivatives pricing: options, swaps, caps, floors, swaptions, and exotic instruments
Interest rate models: Hull-White, Vasicek, CIR, LIBOR Market Model, and others
Pricing methods: Monte Carlo simulation, finite-difference methods, and lattice/tree models
Risk measures: Greeks (delta, gamma, vega, theta), VaR, and sensitivity analysis
Yield curve construction: bootstrapping from market instruments with multiple interpolation methods
Fixed income analytics: bond pricing, duration, convexity, and OAS calculations
Python bindings: QuantLib-Python via SWIG for integration with data science workflows
Modified BSD license: free for commercial and research use
What is QuantLib?
QuantLib is an open-source C++ library for quantitative finance, providing a comprehensive framework for pricing financial instruments, modeling interest rates and credit risk, and computing risk measures across a wide range of asset classes. It is one of the most complete open-source implementations of quantitative finance models available, covering decades of academic and practitioner research in a single, consistently structured library.
Language bindings via SWIG make QuantLib accessible from Python, Java, R, and other environments, allowing quants who work primarily in Python to use the same pricing models as C++ engineers building production systems. The Python bindings (QuantLib-Python) are the most widely used, integrating naturally with pandas and NumPy for data handling alongside QuantLib's pricing logic.
Development teams at FinTech firms and investment banks use QuantLib to implement derivatives pricing systems, risk engines, and regulatory capital models where the cost of a proprietary vendor library is not justified or where full transparency into the pricing model is required.
Financial Instruments and Pricing Methods
QuantLib covers a broad range of financial instruments: vanilla and exotic options on equities, FX, rates, and commodities; interest rate swaps, caps, floors, and swaptions; credit default swaps; bonds including fixed-rate, floating-rate, callable, and convertible structures; and mortgage-backed securities.
For each instrument class, multiple pricing methods are typically available. Monte Carlo simulation handles path-dependent payoffs where closed-form solutions do not exist. Finite-difference methods solve the pricing PDE on a grid, suitable for American options and instruments with early exercise features. Binomial and trinomial trees model discrete exercise opportunities. Analytical approximations cover Black-Scholes, Bachelier, and other standard closed-form cases. Having multiple methods for the same instrument allows calibration and cross-validation, which matters when building production pricing systems where model risk needs to be understood and controlled.
Interest Rate Modeling
QuantLib's interest rate modeling capabilities are particularly deep. It implements the full range of short-rate models (Vasicek, CIR, Hull-White one- and two-factor, Black-Karasinski) and market models (LIBOR Market Model, Swap Market Model). Yield curve construction supports bootstrapping from deposit rates, FRAs, futures, and swap rates using multiple interpolation methods on the discount factor, zero rate, or forward rate space.
For teams building fixed income pricing or rates trading infrastructure, QuantLib's yield curve handling alone justifies the integration. The ability to build curves from live market data, reprice all instruments consistently off a single curve object, and compute sensitivities using bumped curves is the foundation of most rates desk risk systems. Teams building this infrastructure as part of a broader custom financial software engagement typically reach for QuantLib rather than implementing rate models from first principles.
Risk Management Capabilities
QuantLib provides built-in support for computing sensitivities (Greeks) including delta, gamma, vega, theta, and rho for most supported instruments. These are computed either analytically where closed forms exist or numerically via finite differences on the pricing models.
For portfolio-level risk, QuantLib's scenario analysis framework allows repricing under shifted yield curves, volatility surfaces, and spot prices, generating the P&L vectors needed for VaR and expected shortfall calculations. Regulatory capital frameworks that require consistent repricing across large instrument books commonly rely on QuantLib's standardised instrument representations to ensure comparability across the portfolio.
Integration with Python Data Stacks
QuantLib-Python is the standard entry point for quants and data scientists. It exposes the full C++ API through Python objects, so yield curve construction, instrument pricing, and risk calculations can be scripted in Jupyter notebooks alongside pandas data manipulation and matplotlib visualisations.
Common patterns include building yield curves from pandas DataFrames of market data, pricing instrument portfolios with results returned as NumPy arrays, and using QuantLib's date arithmetic alongside Python datetime for proper financial calendar handling. For teams building quantitative infrastructure on modern Python stacks, QuantLib-Python integrates into the same environment as kdb+ PyKX, Bloomberg Open API, and TA-Lib without requiring a separate C++ build environment once the QuantLib-Python wheel is installed.