# milenavuletic/volgan architecture

> Architecture diagram of the GitHub repository milenavuletic/volgan, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/milenavuletic/volgan
- Repository: https://github.com/milenavuletic/volgan

## Overview

VolGAN supports preparing implied-volatility surfaces, training a conditional generative model, simulating surfaces and returns, and assessing arbitrage penalties. The example invokes the data loader and training routine, then samples the trained generator and evaluates penalties. README documents a separate raw-option cleaning and smoothing capability, but the sampled files do not establish how that code connects to VolGAN’s loader. The graph reflects documented or excerpted relationships; unsampled implementation details are not inferred.

Main entry points: [`VolGAN-example.py`](https://github.com/milenavuletic/volgan/blob/main/VolGAN-example.py) (Surface simulation), [`VolGAN.py`](https://github.com/milenavuletic/volgan/blob/main/VolGAN.py) (VolGAN workflow), [`datacleaning.py`](https://github.com/milenavuletic/volgan/blob/main/datacleaning.py) (Option cleaning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Market data preparation"]
  node_cleaning["Option cleaning<br/>[datacleaning.py]"]
  node_surfaceprep["Smoothing and grids<br/>[datacleaning.py]"]
  node_dataingest["Surface data loader<br/>[VolGAN.py]"]
end

subgraph group_model["Generative model"]
  node_gan["VolGAN workflow<br/>[VolGAN.py]"]
  node_generator["Generator<br/>[VolGAN.py]"]
  node_discriminator["Discriminator<br/>[VolGAN.py]"]
  node_training["GAN training<br/>[VolGAN.py]"]
end

subgraph group_analysis["Simulation analysis"]
  node_simulator["Surface simulation<br/>[VolGAN-example.py]"]
  node_penalty["Arbitrage penalties<br/>[VolGAN.py]"]
  node_results["Penalty summaries<br/>[VolGAN-example.py]"]
end

node_researcher(("Researcher"))
node_optionmetrics[("OptionMetrics data")]
node_yahoo["Yahoo Finance"]

node_optionmetrics -->|"provides options"| node_cleaning
node_yahoo -->|"provides spot data"| node_cleaning
node_cleaning -->|"prepares surfaces"| node_surfaceprep
node_researcher -->|"supplies data paths"| node_dataingest
node_dataingest -->|"loads training data"| node_gan
node_researcher -->|"sets training options"| node_gan
node_gan -.->|"uses"| node_generator
node_gan -.->|"uses"| node_discriminator
node_gan -.->|"trains"| node_training
node_researcher -->|"runs example"| node_simulator
node_simulator -->|"calls loader"| node_dataingest
node_simulator -->|"calls training"| node_gan
node_simulator -->|"samples surfaces"| node_generator
node_simulator -->|"calculates penalties"| node_penalty
node_simulator -->|"summarizes penalties"| node_results

click node_cleaning "https://github.com/milenavuletic/volgan/blob/main/datacleaning.py"
click node_surfaceprep "https://github.com/milenavuletic/volgan/blob/main/datacleaning.py"
click node_dataingest "https://github.com/milenavuletic/volgan/blob/main/VolGAN.py"
click node_gan "https://github.com/milenavuletic/volgan/blob/main/VolGAN.py"
click node_generator "https://github.com/milenavuletic/volgan/blob/main/VolGAN.py"
click node_discriminator "https://github.com/milenavuletic/volgan/blob/main/VolGAN.py"
click node_training "https://github.com/milenavuletic/volgan/blob/main/VolGAN.py"
click node_simulator "https://github.com/milenavuletic/volgan/blob/main/VolGAN-example.py"
click node_penalty "https://github.com/milenavuletic/volgan/blob/main/VolGAN.py"
click node_results "https://github.com/milenavuletic/volgan/blob/main/VolGAN-example.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cleaning,node_surfaceprep,node_dataingest toneBlue
class node_gan,node_generator,node_discriminator,node_training,node_optionmetrics toneAmber
class node_simulator,node_penalty,node_results toneMint
class node_researcher,node_yahoo toneIndigo
```

## Components

### Market data preparation

- [Option cleaning](https://github.com/milenavuletic/volgan/blob/main/datacleaning.py): `datacleaning.py`
- [Smoothing and grids](https://github.com/milenavuletic/volgan/blob/main/datacleaning.py): `datacleaning.py`
- [Surface data loader](https://github.com/milenavuletic/volgan/blob/main/VolGAN.py): `VolGAN.py`

### Generative model

- [VolGAN workflow](https://github.com/milenavuletic/volgan/blob/main/VolGAN.py): `VolGAN.py`
- [Generator](https://github.com/milenavuletic/volgan/blob/main/VolGAN.py): `VolGAN.py`
- [Discriminator](https://github.com/milenavuletic/volgan/blob/main/VolGAN.py): `VolGAN.py`
- [GAN training](https://github.com/milenavuletic/volgan/blob/main/VolGAN.py): `VolGAN.py`

### Simulation analysis

- [Surface simulation](https://github.com/milenavuletic/volgan/blob/main/VolGAN-example.py): `VolGAN-example.py`
- [Arbitrage penalties](https://github.com/milenavuletic/volgan/blob/main/VolGAN.py): `VolGAN.py`
- [Penalty summaries](https://github.com/milenavuletic/volgan/blob/main/VolGAN-example.py): `VolGAN-example.py`

### Other components

- **Researcher**
- **OptionMetrics data**
- **Yahoo Finance**

## Connections

- OptionMetrics data → Option cleaning: provides options (evidence: `README.md`)
- Yahoo Finance → Option cleaning: provides spot data (evidence: `datacleaning.py`)
- Option cleaning → Smoothing and grids: prepares surfaces (evidence: `README.md`)
- Researcher → Surface data loader: supplies data paths
- Surface data loader → VolGAN workflow: loads training data (evidence: `VolGAN-example.py`)
- Researcher → VolGAN workflow: sets training options
- VolGAN workflow → Generator: uses (evidence: `VolGAN.py`)
- VolGAN workflow → Discriminator: uses (evidence: `VolGAN.py`)
- VolGAN workflow → GAN training: trains (evidence: `VolGAN.py`)
- Researcher → Surface simulation: runs example (evidence: `VolGAN-example.py`)
- Surface simulation → Surface data loader: calls loader (evidence: `VolGAN-example.py`)
- Surface simulation → VolGAN workflow: calls training (evidence: `VolGAN-example.py`)
- Surface simulation → Generator: samples surfaces (evidence: `VolGAN-example.py`)
- Surface simulation → Arbitrage penalties: calculates penalties (evidence: `VolGAN-example.py`)
- Surface simulation → Penalty summaries: summarizes penalties (evidence: `VolGAN-example.py`)
