Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adversarial Deep Hedging Benchmark

This repository demonstrates the power of Minimax/GAN-based robust optimization for financial derivatives hedging.

Overview

Traditional hedging relies on the Black-Scholes formula, which assumes a log-normal distribution with constant volatility. While optimal in a perfect mathematical world, it fails catastrophically during market crashes.

This project implements Adversarial Deep Hedging. We train a Neural Network "Hedger" to minimize financial risk. Instead of training it on standard geometric brownian motion, we train it against an "Adversarial Market Generator" — a second Neural Network whose entire goal is to generate market paths that maximize the Hedger's loss.

Architecture Difference from Standard GANs

In a standard Image GAN:

  • Generator makes fake images.
  • Discriminator classifies real vs. fake.

In Adversarial Hedging:

  • Generator: Generates future stock price paths (drifts and volatilities). It wins by maximizing the Hedger's financial loss.
  • Hedger (Replaces Discriminator): Decides how many shares to buy/sell to eliminate risk. It wins by minimizing financial loss (via the Entropic Risk Measure).

Models Compared

We conduct a 4-way comparison across standard and stressed market regimes:

  1. Black-Scholes: The classical mathematical baseline.
  2. Standard Deep Hedger: A feedforward neural network trained on normal market data.
  3. GAN (GRU): The adversarial framework utilizing a standard GRU for the Generator.
  4. GAN (LSTM): An improved adversarial framework where the Generator uses an LSTM to better capture long-term temporal dependencies in market stress.

Running the Benchmark

Dependencies: torch, numpy, scipy, matplotlib, pandas, jupyter

The benchmark has been structured into professional folders for clarity:

  • src/: Contains the core Python implementation (Neural Networks, Simulation logic, Training loops).
  • notebooks/: Contains interactive execution notebooks.
  • results/: Contains generated risk metric logs and visual plots.

To run the models and see the visualizations, open the interactive Jupyter Notebooks located in the notebooks/ folder:

  1. notebooks/1_Standard_Hedging_and_Baselines.ipynb: Demonstrates the classical Black-Scholes baseline and trains a standard feedforward Deep Hedger.
  2. notebooks/2_Adversarial_GAN_Hedging.ipynb: Trains the adversarial GRU and LSTM generators against the Hedger, and compares all models in a simulated Regime-Switching Crash market.

Open the notebooks to execute the cells. The notebooks will output detailed risk metrics including:

  • Mean P&L: Average profit/loss across all simulated paths.
  • Std Dev: Standard deviation of returns.
  • VaR (95%): Value at Risk; the threshold loss at the worst 5% tail.
  • CVaR (95%): Conditional Value at Risk; the average expected loss in the worst 5% of scenarios.
  • Worst Case: The absolute maximum drawdown observed.

About

Adversarial Deep Hedging Benchmark evaluating GAN-based hedging against classical Black-Scholes under market stress.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages