# duaashibli/spx-0dte-svjdb-pricing-hedging architecture

> Architecture diagram of the GitHub repository duaashibli/spx-0dte-svjdb-pricing-hedging, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/duaashibli/spx-0dte-svjdb-pricing-hedging
- Repository: https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging

## Overview

This is a quantitative research framework for replicating and stress-testing S&P 500 0DTE option pricing and hedging with an SVJD-B model. The documented user-to-result flow runs from market-data ingestion and validation through econometric estimation, pricing, hedging, validation, and publication figures. The sampled master framework implements many analysis stages in one file; unsampled code is represented only where the README documents its capability. Relationships among documented stages rely on README statements where source excerpts do not show the wiring.

Main entry points: [`svjdb_framework/run_master_svjdb_framework.py`](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py) (Master Analysis), [`scripts/fit_svjdb_emm.py`](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/scripts/fit_svjdb_emm.py) (EMM Estimation), [`src/etl.py`](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/etl.py) (Data Ingestion), [`src/modeling/snp_garch.py`](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/modeling/snp_garch.py) (Auxiliary GARCH Fit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Market Data"]
  node_rawdata["ITCH And OPRA Data"]
  node_etl["Data Ingestion<br/>[etl.py]"]
  node_processed[("Five-Minute Bars")]
end

subgraph group_econometrics["Econometric Estimation"]
  node_master["Master Analysis"]
  node_physical["Physical Estimates"]
  node_jumps["Jump Detection"]
  node_auxfit["Auxiliary GARCH Fit<br/>[snp_garch.py]"]
  node_emmfit["EMM Estimation<br/>[fit_svjdb_emm.py]"]
  node_emm["EMM Objective<br/>[emm.py]"]
end

subgraph group_quant["Pricing And Risk"]
  node_svjdb["SVJD-B Simulator<br/>[svjdb.py]"]
  node_pricing["Option Pricing"]
  node_hedging["Dynamic Hedging"]
end

subgraph group_results["Validation And Results"]
  node_validation["Model Validation"]
  node_plots["Publication Figures<br/>[plots.py]"]
  node_findings["Research Results<br/>[outputs.md]"]
end

node_researcher(("Researcher"))

node_researcher -->|"runs ingestion"| node_etl
node_rawdata -->|"loads archives"| node_etl
node_etl -->|"aggregates bars"| node_processed
node_researcher -->|"runs analysis"| node_master
node_processed -->|"reads datasets"| node_master
node_master -->|"estimates parameters"| node_physical
node_master -->|"detects jumps"| node_jumps
node_processed -.->|"fits returns"| node_auxfit
node_auxfit -->|"provides auxiliary fit"| node_emmfit
node_emmfit -->|"builds objective"| node_emm
node_emm -->|"simulates candidates"| node_svjdb
node_emmfit -->|"loads simulator"| node_svjdb
node_master -->|"prices options"| node_pricing
node_master -->|"simulates hedges"| node_hedging
node_master -->|"checks model"| node_validation
node_master -->|"supplies analysis"| node_plots
node_plots -->|"generates figures"| node_findings
node_validation -.->|"reports results"| node_findings

click node_etl "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/etl.py"
click node_master "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py"
click node_physical "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py"
click node_jumps "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py"
click node_auxfit "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/modeling/snp_garch.py"
click node_emmfit "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/scripts/fit_svjdb_emm.py"
click node_emm "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/modeling/emm.py"
click node_svjdb "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/modeling/svjdb.py"
click node_pricing "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py"
click node_hedging "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py"
click node_validation "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py"
click node_plots "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/plots.py"
click node_findings "https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/outputs.md"

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_rawdata,node_etl,node_processed toneBlue
class node_master,node_physical,node_jumps,node_auxfit,node_emmfit,node_emm toneAmber
class node_svjdb,node_pricing,node_hedging toneMint
class node_validation,node_plots,node_findings toneRose
class node_researcher toneIndigo
```

## Components

### Market Data

- **ITCH And OPRA Data**
- [Data Ingestion](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/etl.py): `src/etl.py`
- **Five-Minute Bars**

### Econometric Estimation

- [Master Analysis](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py): `svjdb_framework/run_master_svjdb_framework.py`
- [Physical Estimates](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py): `svjdb_framework/run_master_svjdb_framework.py`
- [Jump Detection](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py): `svjdb_framework/run_master_svjdb_framework.py`
- [Auxiliary GARCH Fit](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/modeling/snp_garch.py): `src/modeling/snp_garch.py`
- [EMM Estimation](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/scripts/fit_svjdb_emm.py): `scripts/fit_svjdb_emm.py`
- [EMM Objective](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/modeling/emm.py): `src/modeling/emm.py`

### Pricing And Risk

- [SVJD-B Simulator](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/src/modeling/svjdb.py): `src/modeling/svjdb.py`
- [Option Pricing](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py): `svjdb_framework/run_master_svjdb_framework.py`
- [Dynamic Hedging](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py): `svjdb_framework/run_master_svjdb_framework.py`

### Validation And Results

- [Model Validation](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/run_master_svjdb_framework.py): `svjdb_framework/run_master_svjdb_framework.py`
- [Publication Figures](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/plots.py): `svjdb_framework/plots.py`
- [Research Results](https://github.com/duaashibli/spx-0dte-svjdb-pricing-hedging/blob/main/svjdb_framework/outputs.md): `svjdb_framework/outputs.md`

### Other components

- **Researcher**

## Connections

- Researcher → Data Ingestion: runs ingestion (evidence: `README.md`)
- ITCH And OPRA Data → Data Ingestion: loads archives (evidence: `src/etl.py`)
- Data Ingestion → Five-Minute Bars: aggregates bars (evidence: `src/etl.py`)
- Researcher → Master Analysis: runs analysis (evidence: `README.md`)
- Five-Minute Bars → Master Analysis: reads datasets (evidence: `svjdb_framework/run_master_svjdb_framework.py`)
- Master Analysis → Physical Estimates: estimates parameters (evidence: `README.md`)
- Master Analysis → Jump Detection: detects jumps (evidence: `README.md`)
- Five-Minute Bars → Auxiliary GARCH Fit: fits returns
- Auxiliary GARCH Fit → EMM Estimation: provides auxiliary fit (evidence: `src/modeling/snp_garch.py`)
- EMM Estimation → EMM Objective: builds objective (evidence: `scripts/fit_svjdb_emm.py`)
- EMM Objective → SVJD-B Simulator: simulates candidates (evidence: `src/modeling/emm.py`)
- EMM Estimation → SVJD-B Simulator: loads simulator (evidence: `scripts/fit_svjdb_emm.py`)
- Master Analysis → Option Pricing: prices options (evidence: `README.md`)
- Master Analysis → Dynamic Hedging: simulates hedges (evidence: `README.md`)
- Master Analysis → Model Validation: checks model (evidence: `README.md`)
- Master Analysis → Publication Figures: supplies analysis (evidence: `svjdb_framework/plots.py`)
- Publication Figures → Research Results: generates figures (evidence: `README.md`)
- Model Validation → Research Results: reports results
