Hedgehog is a modular, SciML-inspired derivatives pricing library in Julia.
All pricing and calibration workflows follow a SciML-inspired solve(problem, method)
interface.
To compute a price, you define a PricingProblem
using:
- A payoff (e.g. European call, American put)
- A set of market inputs (e.g. Black-Scholes inputs, Heston inputs)
- Then solve it with a pricing method (e.g. Monte Carlo, analytical formula, Fourier inversion)
payoff = VanillaOption(...)
market = BlackScholesInputs(...)
problem = PricingProblem(payoff, market)
sol = solve(problem, BlackScholesAnalytic())
price = sol.price
- European Call / Put
- American Call / Put
- Black-Scholes (
LognormalDynamics
) - Heston (
HestonDynamics
)
- Analytical formulas (Black-Scholes)
- Binomial Trees (Cox–Ross–Rubinstein)
- Monte Carlo:
- Euler–Maruyama
- Exact simulation (Black-Scholes, Broadie–Kaya for Heston)
- Fourier methods (Carr–Madan)
Hedgehog supports calibration via a unified interface:
- Solve for implied volatility using
CalibrationProblem
- Invert volatility surfaces
- Build fully calibrated
RectVolSurface
objects from price matrices
- Greeks supported via a
GreekProblem
interface:- Finite differences
- Automatic differentiation
BatchGreekProblem
to compute a full gradient of sensitivities
- Modular by construction: models, payoffs, and methods are swappable
- Unified
solve(problem, method)
interface across pricing and calibration - Inspired by the SciML architecture and ecosystem
- Built on top of SciML components (StochasticDiffEq.jl, NonlinearSolve.jl, Integrals.jl)
- Open-source and focused on prototyping cutting-edge methods
Hedgehog is built on several high-quality Julia packages:
-
- StochasticDiffEq.jl - For stochastic simulation
- NonlinearSolve.jl - For calibration and implied volatility
- Integrals.jl - For Fourier-based pricing methods
- Optimization.jl - For advanced calibration
- DataInterpolations.jl - For volatility surfaces and rate curves
-
ForwardDiff.jl - Automatic differentiation for Greeks calculation
-
Accessors.jl - Functional lens-based access for Greeks and calibration
-
Distributions.jl - For statistical distributions and sampling
Complete documentation is available at https://alecombi.github.io/Hedgehog.jl/
Example scripts demonstrating Hedgehog's functionality can be found in the examples/
directory:
examples/
- Standalone Julia scripts for various pricing scenariosexamples/notebooks/
- Pluto notebooks for interactive exploration (in progress)
These examples cover various use cases from basic option pricing to calibration scenarios and are designed to help you get started with the library.
Hedgehog.jl builds on the ideas and complements a number of Julia packages for derivatives pricing. Here's how it compares:
Implements classic models like Black-Scholes and binomial trees for vanilla options, with support for asian options too, which are not available in Hedgehog yet. Hedgehog aims at extending these ideas with automatic differentiation, calibration tools, and a modular problem-method interface.
Focused on Fourier-based pricing under models like Heston. It implements COS method, which is not in Hedgehog at the moment. Hedgehog includes characteristic function methods too with Carr-Madan, including them within a broader framework for simulation, calibration, and AD/FD sensitivities.
🧰 AQFED.jl
A deep and ambitious package accompanying a book on equity derivatives. Covers topics like basket options and rough paths. It has a deep coverage of cutting-edge methods. Hedgehog aims for a more modular and general-purpose architecture, designed for reuse and extensibility.
🧰 Bruno.jl
A promising package combining simulation, pricing, and delta hedging. However, it hasn’t been updated in over two years. Hedgehog is under active development and structured for long-term flexibility.
A pure Julia port of the C++ QuantLib library. It offers broad model coverage but hasn’t been active in the last 5 years. Hedgehog focuses on modern Julia design, composability, and integration with scientific computing tools.
- Modular design with SciML-style
solve(problem, method)
interface - Automatic and finite difference Greeks, with lens-based parameter access (
Accessors.jl
) - Built on Julia’s scientific stack, including
DifferentialEquations.jl
- Actively developed with extensibility and composability as core design goals
Hedgehog aims to provide a clean, Julia-native foundation for derivatives pricing, sensitivities, and calibration — suited for research, prototyping, and production use.
Contributions are welcome! If you have ideas for new features, models, or improvements, feel free to open an issue or submit a pull request.
You can also reach out to Alessandro Combi via the Julia Zulip chat for questions or discussion.