Skip to content

Repository files navigation

PCMF — Multi-Cashflow Hedging Engine

Distributed pricing and delta-hedging engine for multi-asset, multi-cashflow derivatives under Black-Scholes. The system prices and hedges basket and max options with up to 8 underlying assets and multiple cashflow dates using Monte Carlo simulation.

Architecture

The project follows a client-server architecture communicating over gRPC:

  • Pricing Server (C++): Monte Carlo pricer computing option prices and deltas (finite differences) under multi-dimensional Black-Scholes with correlated Brownian motions (Cholesky decomposition).
  • Hedging Client (C#/.NET): Manages the self-financing hedging portfolio, handles rebalancing at each cashflow date, and tracks P&L over the life of the derivative.

Supported Products

Product Description
Basket Option Weighted average of underlying assets vs. strike
Max Option Maximum of underlying assets vs. strike

Both products support multiple cashflow dates and arbitrary numbers of underlyings (tested up to 8).

Project Milestones

  1. Architecture design and validation of the mathematical hedging framework
  2. gRPC client-server communication (skeleton)
  3. Vanilla call hedging implementation
  4. Full multi-asset, multi-cashflow hedging for basket and max options

Usage

1. Start the pricing server

./pricing_server <path_to_math_param.json>

2. Run the hedging client

dotnet run <param.json> <mkt_data.csv> <output.json>

Examples

Basket option — 5 underlyings, 3 cashflows:

./pricing_server ../../TestCases/Basket_5_3_1/basket_5_3_1_math_param.json
dotnet run ../TestCases/Basket_5_3_1/basket_5_3_1_param.json ../TestCases/Basket_5_3_1/basket_5_3_1_mkt_data.csv ../tests/res_basket_5_3_1.json

Basket option — 8 underlyings, 4 cashflows:

./pricing_server ../../TestCases/Basket_8_4_3/basket_8_4_3_math_param.json
dotnet run ../TestCases/Basket_8_4_3/basket_8_4_3_param.json ../TestCases/Basket_8_4_3/basket_8_4_3_mkt_data.csv ../tests/res_basket_8_4_3.json

Max option — 5 underlyings, 3 cashflows:

./pricing_server ../../TestCases/Max_5_3_1/max_5_3_1_math_param.json
dotnet run ../TestCases/Max_5_3_1/max_5_3_1_param.json ../TestCases/Max_5_3_1/max_5_3_1_mkt_data.csv ../tests/res_max_5_3_1.json

Max option — 8 underlyings, 4 cashflows:

./pricing_server ../../TestCases/Max_8_4_3/max_8_4_3_math_param.json
dotnet run ../TestCases/Max_8_4_3/max_8_4_3_param.json ../TestCases/Max_8_4_3/max_8_4_3_mkt_data.csv ../tests/res_max_8_4_3.json

Tech Stack

  • C++ — Monte Carlo pricing engine
  • C# / .NET — Hedging client
  • gRPC — Client-server communication
  • CMake — C++ build system
  • NUnit — Unit testing

Academic Context

Project completed at ENSIMAG, Grenoble INP as part of the Quantitative Finance specialization (MEQA), 2024–2025.

About

projet couverture multi-flux

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages