{"id":49355207,"url":"https://github.com/maximefarre/options-pricing-cpp","last_synced_at":"2026-04-27T13:02:44.288Z","repository":{"id":328298989,"uuid":"1096536929","full_name":"MaximeFARRE/options-pricing-cpp","owner":"MaximeFARRE","description":"C++ implementation of European, American and Asian option pricing using Black-Scholes, Monte Carlo simulation and CRR binomial tree.","archived":false,"fork":false,"pushed_at":"2026-04-21T17:45:47.000Z","size":238,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-21T19:42:45.733Z","etag":null,"topics":["binomial-tree","black-sholes-model","cpp","crr","finance","monte-carlo","option-pricing"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaximeFARRE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-14T15:13:38.000Z","updated_at":"2026-04-21T18:43:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MaximeFARRE/options-pricing-cpp","commit_stats":null,"previous_names":["maximefarre/projet-finance-cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MaximeFARRE/options-pricing-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Foptions-pricing-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Foptions-pricing-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Foptions-pricing-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Foptions-pricing-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaximeFARRE","download_url":"https://codeload.github.com/MaximeFARRE/options-pricing-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Foptions-pricing-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32337274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binomial-tree","black-sholes-model","cpp","crr","finance","monte-carlo","option-pricing"],"created_at":"2026-04-27T13:02:43.514Z","updated_at":"2026-04-27T13:02:44.275Z","avatar_url":"https://github.com/MaximeFARRE.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Financial Options Pricing Library — C++\n\nA C++ library implementing pricing models for European, American, and Asian financial options, developed as part of an applied quantitative finance course at [ESILV](https://www.esilv.fr/) (École Supérieure d'Ingénieurs Léonard de Vinci).\n\n---\n\n## Overview\n\nThis project implements three standard option pricing methodologies and applies them to four families of derivative instruments. The goal is to provide a clean, object-oriented implementation that reflects the mathematical models taught in quantitative finance courses, with emphasis on correctness, extensibility, and numerical performance.\n\n---\n\n## Features\n\n### Option types supported\n\n| Family | Variants |\n|---|---|\n| European Vanilla | Call, Put |\n| European Digital (Binary) | Call, Put |\n| American | Call, Put |\n| Asian (arithmetic average) | Call, Put |\n\n### Pricing models\n\n| Model | Applicable options | Method |\n|---|---|---|\n| **Black-Scholes** (closed form) | European Vanilla, European Digital | Analytical formula with `N(d1)`, `N(d2)` |\n| **Black-Scholes Monte Carlo** | All option types (via path simulation) | GBM path simulation with Mersenne Twister RNG |\n| **Cox-Ross-Rubinstein (CRR)** | European, American | Binomial tree with backward induction and early exercise |\n\n### Additional capabilities\n\n- Delta computation for European options (Black-Scholes)\n- 95% confidence interval on Monte Carlo estimates\n- CRR pricer callable in closed-form approximation mode (via Black-Scholes parameter conversion)\n- Early exercise detection stored in a binary exercise tree (American options)\n- Path-dependent payoff support for Asian options (arithmetic average)\n- Execution time measurement\n\n---\n\n## Project structure\n\n```\nProjet-Finance-Cpp/\n├── Projet C++/                  # All source files\n│   ├── Option.h / .cpp          # Abstract base class for all options\n│   │\n│   ├── EuropeanVanillaOption.h / .cpp   # European vanilla base\n│   ├── CallOption.h / .cpp              # European vanilla call\n│   ├── PutOption.h / .cpp               # European vanilla put\n│   │\n│   ├── EuropeanDigitalOption.h / .cpp   # European digital base\n│   ├── EuropeanDigitalCallOption.h / .cpp\n│   ├── EuropeanDigitalPutOption.h / .cpp\n│   │\n│   ├── AmericanOption.h / .cpp          # American option base\n│   ├── AmericanCallOption.h / .cpp\n│   ├── AmericanPutOption.h / .cpp\n│   │\n│   ├── AsianOption.h / .cpp             # Asian option base (path-dependent)\n│   ├── AsianCallOption.h / .cpp\n│   ├── AsianPutOption.h / .cpp\n│   │\n│   ├── BlackScholesPricer.h / .cpp      # Closed-form BS pricer\n│   ├── BlackScholesMCPricer.h / .cpp    # Monte Carlo BS pricer\n│   ├── CRRPricer.h / .cpp               # CRR binomial tree pricer\n│   │\n│   ├── BinaryTree.h / .cpp              # Generic template binary tree\n│   ├── MT.h / .cpp                      # Mersenne Twister RNG (singleton)\n│   │\n│   └── main.cpp                         # Entry point with usage examples\n│\n├── Projet C++.sln                       # Visual Studio solution file\n└── Projet C++.vcxproj                   # Visual Studio project file\n```\n\n---\n\n## Architecture\n\nThe design follows a clean polymorphic hierarchy:\n\n```\nOption  (abstract)\n├── EuropeanVanillaOption  (abstract)\n│   ├── CallOption\n│   └── PutOption\n├── EuropeanDigitalOption  (abstract)\n│   ├── EuropeanDigitalCallOption\n│   └── EuropeanDigitalPutOption\n├── AmericanOption  (abstract)\n│   ├── AmericanCallOption\n│   └── AmericanPutOption\n└── AsianOption  (abstract, path-dependent)\n    ├── AsianCallOption\n    └── AsianPutOption\n\nPricers  (independent, accept Option*)\n├── BlackScholesPricer      — closed-form, European only\n├── BlackScholesMCPricer    — simulation, all option types\n└── CRRPricer               — binomial tree, European and American\n\nUtilities\n├── BinaryTree\u003cT\u003e           — generic template tree used by CRR\n└── MT                      — Mersenne Twister singleton (thread-local RNG)\n```\n\nPricers are decoupled from the option hierarchy and interact through the `Option` abstract interface. Path-dependent options override `payoffPath()` to provide custom averaging logic consumed by the Monte Carlo pricer.\n\n---\n\n## Requirements\n\n- C++17 or later\n- Visual Studio 2019 / 2022 (Windows) — project files included\n- Standard library only — no external dependencies\n\n---\n\n## Build and run\n\n### Visual Studio (Windows)\n\n1. Open `Projet C++.sln` in Visual Studio.\n2. Select the desired configuration (`Debug` or `Release`).\n3. Build the solution (`Ctrl+Shift+B`).\n4. Run the executable (`F5` or `Ctrl+F5`).\n\n### Command line (GCC / Clang)\n\n```bash\n# From the \"Projet C++/\" directory\ng++ -std=c++17 -O2 -o pricer \\\n    Option.cpp \\\n    CallOption.cpp PutOption.cpp EuropeanVanillaOption.cpp \\\n    EuropeanDigitalOption.cpp EuropeanDigitalCallOption.cpp EuropeanDigitalPutOption.cpp \\\n    AmericanOption.cpp AmericanCallOption.cpp AmericanPutOption.cpp \\\n    AsianOption.cpp AsianCallOption.cpp AsianPutOption.cpp \\\n    BlackScholesPricer.cpp BlackScholesMCPricer.cpp \\\n    CRRPricer.cpp MT.cpp BinaryTree.cpp \\\n    main.cpp\n\n./pricer\n```\n\n---\n\n## Usage\n\nThe entry point `main.cpp` demonstrates how to instantiate options and compute prices.\n\n### Example — European call (Monte Carlo)\n\n```cpp\ndouble T     = 5.0;    // maturity (years)\ndouble K     = 101.0;  // strike price\ndouble S0    = 100.0;  // initial spot price\ndouble r     = 0.01;   // risk-free rate\ndouble sigma = 0.10;   // volatility\n\nCallOption euroCall(T, K);\n\nBlackScholesMCPricer mcPricer(\u0026euroCall, S0, r, sigma);\nmcPricer.generate(1'000'000);\n\ndouble price = mcPricer();\nauto ci      = mcPricer.confidenceInterval();   // 95% CI\n\nstd::cout \u003c\u003c \"Price : \" \u003c\u003c price \u003c\u003c \"\\n\";\nstd::cout \u003c\u003c \"CI95% : [\" \u003c\u003c ci[0] \u003c\u003c \", \" \u003c\u003c ci[1] \u003c\u003c \"]\\n\";\n```\n\n### Example — European call (Black-Scholes closed form)\n\n```cpp\nBlackScholesPricer bsPricer(\u0026euroCall, S0, r, sigma);\ndouble price = bsPricer();\ndouble delta = bsPricer.delta();\n```\n\n### Example — American put (CRR binomial tree)\n\n```cpp\nint    N = 5;\ndouble U = 0.05;    // up factor\ndouble D = -0.045;  // down factor\ndouble R = 0.01;    // per-step interest rate\n\nAmericanPutOption amerPut(T, K);\nCRRPricer crrPricer(\u0026amerPut, N, S0, U, D, R);\ndouble price = crrPricer(false);   // false = standard tree, true = closed-form approx\n```\n\n### Example — Asian call (Monte Carlo)\n\n```cpp\nint N = 5;\nstd::vector\u003cdouble\u003e timeSteps;\nfor (int k = 1; k \u003c= N; ++k)\n    timeSteps.push_back(T * k / N);\n\nAsianCallOption asianCall(timeSteps, K);\n\nBlackScholesMCPricer mcAsian(\u0026asianCall, S0, r, sigma);\nmcAsian.generate(1'000'000);\ndouble price = mcAsian();\n```\n\n---\n\n## Sample output\n\n```\nEuropean Call IC95% : [12.043218, 12.052781]\n\n================ MC (BlackScholesMCPricer) ================\nEuropean Call        : 12.047999\n\nExecution time: 1.823412 seconds\n```\n\n---\n\n## Known limitations\n\n- The CRR pricer does not support Asian options (path dependency is incompatible with standard binomial trees).\n- The Black-Scholes closed-form pricer supports European options only; American and Asian options require the Monte Carlo pricer.\n- The Monte Carlo pricer currently uses a fixed number of paths per `generate()` call; incremental simulation is supported by calling `generate()` multiple times.\n- No CMake build system is provided; compilation on non-Windows platforms requires manual file listing (see command-line build instructions above).\n- The random number generator uses a fixed initial seed; results are deterministic across runs with the same seed.\n\n---\n\n## Contributors\n\n| Name | GitHub | Role |\n|---|---|---|\n| Maxime Farré | [@MaximeFARRE](https://github.com/MaximeFARRE) | Asian options, Monte Carlo pricer, project integration |\n| Chloé Chaufour | [@chloe28072004](https://github.com/chloe28072004) | American options, CRR pricer, Black-Scholes pricer fix |\n| Mathilde Destailleur | [@mathildedest](https://github.com/mathildedest) | BinaryTree, CRR pricer |\n| Auriane Carron | [@AurianeCarron73](https://github.com/AurianeCarron73) | European options base |\n| Emilien Combaret | [@EmilienCbrt](https://github.com/EmilienCbrt) · [@EmilienCombaret](https://github.com/EmilienCombaret) | Code review, documentation |\n\n---\n\n## Academic context\n\nThis project was developed as part of the **C++ Programming** course at ESILV (École Supérieure d'Ingénieurs Léonard de Vinci), in the 4th year of the engineering program (semester 7), academic year 2025–2026.\n\nThe project demonstrates:\n- Object-oriented design with abstract base classes and polymorphism\n- Template programming (`BinaryTree\u003cT\u003e`)\n- Numerical methods in finance (Monte Carlo simulation, binomial tree)\n- Analytical option pricing (Black-Scholes formula with normal CDF/PDF)\n- Standard C++ library usage (`\u003cvector\u003e`, `\u003cchrono\u003e`, `\u003ccmath\u003e`, `\u003ciostream\u003e`)\n\n---\n\n## Project status\n\n**Complete** — submitted December 2025. No active development planned.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximefarre%2Foptions-pricing-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximefarre%2Foptions-pricing-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximefarre%2Foptions-pricing-cpp/lists"}