Metadata-Version: 2.4
Name: gamma-wall
Version: 0.1.1
Summary: Gamma Exposure analytics for Nubra option-chain snapshots
Author: Akshay N
License-Expression: MIT
Project-URL: Homepage, https://github.com/akshayn-spec/gamma-wall
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Provides-Extra: table
Requires-Dist: tabulate>=0.9; extra == "table"
Provides-Extra: all
Requires-Dist: tabulate>=0.9; extra == "all"
Dynamic: license-file

# gamma-wall

Gamma Exposure (GEX) analytics for Nubra option-chain snapshots.

This package works like `nubra_talib`: install it, import a function, pass the Nubra SDK output, and print the analytics. It does not require JSON files, Streamlit, React, or any frontend.

## Install

```bash
python -m pip install gamma-wall
```

For prettier terminal tables:

```bash
python -m pip install "gamma-wall[table]"
```

## Minimal Usage

```python
from nubra_python_sdk.marketdata.market_data import MarketData
from nubra_python_sdk.start_sdk import InitNubraSdk, NubraEnv

from gamma_wall import print_gex

nubra = InitNubraSdk(NubraEnv.UAT, env_creds=True)
market_data = MarketData(nubra)

result = market_data.option_chain("NIFTY", exchange="NSE")
print_gex(result, symbol="NIFTY")
```

`print_gex()` reads these fields from the Nubra SDK response:

- `result.chain.current_price`
- `result.chain.ce`
- `result.chain.pe`
- `strike_price`
- `open_interest`
- `gamma`
- `iv`
- `last_traded_price`

If you want to override the spot price:

```python
print_gex(result, symbol="NIFTY", spot_price=24512)
```

## What It Prints

- Top gamma walls by absolute net gamma
- Strongest positive gamma wall
- Strongest negative gamma wall
- Gamma flip zone
- Dealer positioning bias
- Total market gamma
- Top 5 call walls
- Top 5 put walls
- Decision levels summary

## Formula

```text
GEX = gamma * OI * spot_price^2
```

Put GEX is signed negative:

```text
net_gex = call_gex + put_gex
```

## Python API

```python
from gamma_wall import calculate_gex, aggregate_by_strike, summarize_gex, print_gex
```

`print_gex()` returns the aggregated strike-level DataFrame if you want to use it further:

```python
levels = print_gex(result, symbol="NIFTY")
summary = summarize_gex(levels)
```

## Build For PyPI

```bash
python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*
```
