Skip to content

Repository files navigation

GexLab v2

OPTIONS INTELLIGENCE STUDIO GEXLAB V2 Dealer gamma, volatility structure, expiry pressure, replay, and TradingView bridge workflows.


Next.js React FastAPI Tailwind Status

A multi-page options analytics studio for SPY and QQQ.

GexLab v2 blends live chain ingestion, dealer-greek analytics, relevant level extraction, futures conversion, saved end-of-day replay, macro event context, and a TradingView payload bridge into one routed dashboard.


Why This Exists

Most retail-facing options dashboards either:

  • stop at raw chain data,
  • flatten everything into one noisy screen,
  • or hide the actual structural map behind generic charts.

GexLab v2 is built around a different idea:

  • show dealer positioning clearly,
  • separate workflows into focused pages,
  • keep replay and live mode in the same product,
  • make important levels portable into TradingView,
  • and preserve a high-signal studio feel instead of a spreadsheet feel.

Signal Stack

FLOW ENGINE Chain Ingestion Yahoo chain pulls Basis lookup Snapshot storage QUANT LAYER Dealer Analytics GEX / DEX / VEX / CHEX Gamma flip / walls / max pain Per-expiry structural levels STUDIO LAYER Routed Dashboard Replay + live views Theme + futures mode TradingView bridge

What You Can Do

Core analytics

  • Track net GEX, DEX, vega, charm, and strike-level pressure.
  • Surface gamma flip, call wall, put wall, session ceiling, session floor, max pain, vanna magnet, and more.
  • Inspect OI walls, weak OI pockets, protected gamma ranges, aggressive flow levels, and skew-rich / skew-cheap strikes.
  • Filter relevant levels by DTE for near-expiry structure up to 5 days.

Live + replay workflow

  • Poll live SPY / QQQ data during active sessions.
  • Save EOD-style snapshots to local storage under data/snapshots/....
  • Jump to historical dates and replay the same analytics stack off saved files.
  • Fall back to saved data overnight instead of leaving the UI empty.

Usability layer

  • Switch between ETF native and futures converted pricing.
  • Use dark / light mode across the full studio.
  • Move through dedicated pages instead of one overloaded dashboard.
  • Reorder sidebar navigation by dragging and dropping items.
  • Keep per-page scroll position when switching routes.

External workflow bridge

  • Export a compressed TradingView payload.
  • Use the bundled Pine indicator scaffold in gexlab_v2_indicator.txt.
  • Carry richer relevant levels into TV instead of only a minimal wall set.

Studio Map

Page Purpose Best For
Overview Regime, key levels, ladder, near-term pressure, quick summary Fast daily read
Levels Grouped market landmarks by theme Mapping the tape
Exposure Gamma concentration, heat, ladder, strike inspection Dealer pressure zones
Volatility IV surface and skew structure Vol terrain
Chain Expiry mix, term structure, ratio panels Positioning by expiry
Vega Vol sensitivity by strike Vol risk clustering
Charm Time-decay flow pressure Intraday decay read
Events Macro calendar and structural markers Decision context
Ledger Contract-by-contract raw inspection Deep audit

Visual Architecture

                         GEXLAB V2
        ┌──────────────────────────────────────────────┐
        │            Next.js Studio Frontend           │
        │  overview • levels • exposure • replay • TV │
        └──────────────────────┬───────────────────────┘
                               │
                     /api/metrics/*  /api/history/*
                               │
        ┌──────────────────────▼───────────────────────┐
        │              FastAPI Quant Backend           │
        │ ingestion • basis • analytics • levels       │
        └───────────────┬───────────────┬──────────────┘
                        │               │
                Yahoo / basis     Macro event sources
                        │               │
                        ▼               ▼
                local snapshots     cached event feed

Feature Deep Dive

Relevant Levels Engine

The levels layer is not just a few headline strikes. It currently supports:

  • aggregated call / put walls
  • top wall clusters
  • gamma flip
  • max pain
  • session ceiling / floor
  • OI call / put walls
  • weak OI call / put levels
  • protected gamma highs / lows
  • aggressive call ceiling / put floor
  • skew rich / skew cheap strikes
  • per-DTE variants of the above
Replay + User Data

Snapshots are written locally so historical mode does not depend on the upstream chain source supporting good history.

That also means users can add their own files manually:

data/
  snapshots/
    SPY/
      2026-04-10.json
    QQQ/
      2026-04-10.json

If a snapshot follows the saved payload shape, it becomes selectable in the UI automatically.

Macro Event Layer

The app favors official or near-official macro context over generic market-news clutter.

Current event sources include:

  • BLS event timing
  • Federal Reserve FOMC calendar parsing
  • structural options markers like 0DTE, 1DTE, and monthly OPEX
  • optional local custom events
TradingView Bridge

The backend can compress the latest level set into a compact payload for TradingView workflows.

That bridge can include:

  • gamma flip
  • call / put walls
  • max pain
  • vanna magnet
  • richer derived structural levels

Quick Start

1. Backend

cd backend
venv\Scripts\python -m pip install -r requirements.txt
venv\Scripts\python -m uvicorn main:app --reload

2. Frontend

cd frontend
npm install
npm run dev

3. Open the studio

Frontend: http://localhost:3000
Backend:  http://127.0.0.1:8000

4. One-command local launch

run.bat

API Surface

Health + core data

  • GET /
  • GET /api/health
  • GET /api/metrics/raw
  • GET /api/metrics/analytics/{ticker}
  • GET /api/metrics/bridge/{ticker}

Replay + snapshots

  • GET /api/history/{ticker}/dates
  • GET /api/history/{ticker}/{snapshot_date}

Macro context

  • GET /api/events/macro

Local Data Layout

backend/
  services/
    analytics/
    macro_events.py
    storage.py
  tests/
  main.py
  models.py

frontend/
  src/
    app/
    components/
    hooks/
    lib/
    types/

data/
  snapshots/
    SPY/
    QQQ/

Stack

Frontend

  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS v4
  • framer-motion
  • next-themes
  • Recharts
  • Plotly

Backend

  • FastAPI
  • uvicorn
  • yfinance
  • pandas
  • numpy
  • scipy
  • httpx

Design Notes

The UI direction for this repo is intentionally not “generic dashboard SaaS.”

It is designed to feel:

  • editorial
  • premium
  • high-signal
  • restrained in motion
  • readable under heavy information density

That design guidance is also captured in .impeccable.md.


Repo Highlights

flowchart LR
    A[Raw Chain] --> B[Analytics Engine]
    B --> C[Level Intelligence]
    C --> D[Studio Pages]
    C --> E[TradingView Bridge]
    B --> F[Snapshot Storage]
    G[Macro Events] --> D
    F --> D
Loading

Current Strengths

  • focused routed experience instead of one bloated page
  • local replay and user-added snapshots
  • official-source macro context direction
  • strong relevant-level extraction
  • futures conversion workflow
  • TradingView handoff path

Practical Limitations

  • live options chain data currently relies on yfinance, which is practical but not a licensed direct-feed solution
  • macro events are cleaner than market-news integration, by design
  • local snapshot quality depends on the chain data available when saved

Suggested Next Steps

  • add README screenshots / GIFs once the UI settles
  • add a sample snapshot JSON template for user imports
  • add a reset sidebar order control in-app
  • add tests around more derived level families
  • add a production deployment guide

TradingView Note

Use the bundled indicator scaffold here:

Typical workflow:

  1. Open the dashboard.
  2. Copy the bridge payload.
  3. Paste it into the indicator inputs.
  4. Toggle the level families you want visible in TV.

License / Use

This repo is currently structured like a private project workspace. If you plan to open-source it, the next step is to add an explicit license and a cleaned-up contribution section.


GEXLAB V2 • LIVE STRUCTURE • REPLAY • BRIDGE

About

All-In-One suite for Options Flow Analysis

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages