← back
MAPE — Multi-Asset Pricing Engine
core, FFI & GUI implemented
A quantitative pricing engine in C++20 with a Rust/egui desktop GUI
and an optional real-market-data layer. The C++ core is exposed to Rust through a
stable C ABI, and a small Python script feeds it live option quotes for
implied-volatility analysis.
C++20Rustegui
CMakePythonC ABI
What's implemented
- Domain types — MarketData, Option (European/American, call/put), Bond, FX forward, vanilla payoffs, a std::variant-based Instrument
- Templated engine —
Pricer<Model> constrained by C++20 concepts (PricingModel, Payoff, StochasticProcess) — one generic engine, no virtual dispatch
- Models — Black–Scholes–Merton (closed form + analytic Greeks), Cox–Ross–Rubinstein binomial tree (American), Monte Carlo, Crank–Nicolson finite-difference PDE (American)
- Threading — parallel Monte Carlo with independent per-thread RNG streams, a thread pool, and concurrent portfolio pricing
- Exotics — path-dependent Monte Carlo with Asian, barrier (knock in/out), and lookback payoffs
- Fixed income — analytic fixed-coupon bond and FX forward pricing (covered interest parity)
- AD Greeks — forward-mode automatic differentiation via dual numbers — exact delta/vega/rho, no bumping
- Implied vol — Newton + bisection solver inverting Black-Scholes on a market price
- Real market data — optional SQLite cache populated by a yfinance fetcher; GUI plots a volatility smile from real option chains
- Rust GUI — eframe/egui desktop app: single-instrument pricing + Greeks, threaded portfolio reprice, convergence chart
Status
Core, FFI, and the Rust GUI are implemented, including exotic path-dependent payoffs,
bond/FX pricing, AD Greeks, the implied-vol solver, and GUI convergence + volatility-smile
charts. The C++ core passes 104 checks and is clean under ThreadSanitizer. A representative
4-core benchmark run shows parallel Monte Carlo reaching ~3.9× speedup (≈97% efficiency)
at 4 threads.
Engineering
CI, static analysis, and Codecov coverage on every push. Reformatting enforced via clang-format/clang-tidy.