Skip to content

About

A free, local live map of option gamma exposure (GEX) for SPY, QQQ, SPX, NDX and stocks: walls, gamma flip, regime, size and trade guidance. Not financial advice.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

81 stars

Watchers

1 watching

Forks

Repository files navigation

Edge GEX Lab

CI Latest release License: MIT

A local live map of modeled option gamma exposure (GEX) by strike for SPY, QQQ, SPX, NDX and any optionable US stock. It shows the call wall, the put wall, every gamma flip, the regime at spot, how big net GEX is next to the stock's own daily dollar volume, and a trade guidance panel that turns the map into levels and scenarios with every number traceable to the map. Built for active traders who want to see where option gamma sits without paying for a GEX service.

  • Runs on your computer. No account, no telemetry, the server listens on 127.0.0.1 only. The only call home is a once-a-day check for a new release, and you can turn it off.
  • Every number is shown with how it was made. OI date and source, feed, valuation time, coverage and the sign assumption are on the map, not in a footnote.
  • AI is optional and fenced. The guidance is a deterministic template. "Explain this map" can ask your local claude CLI for a narrative; a validator rejects any number or promise not in the data.
  • Market data you control. Your own Alpaca keys (the free plan works). REST only, rate capped.
  • Free and MIT licensed. No paid tier.

New in v1.4.0: an optional Schwab source. With a Schwab brokerage account and a free Schwab developer app, SPX and NDX come from Schwab in real time, and NDX (map and /NQ Futures view) works again. Without Schwab nothing changes: SPX comes from Alpaca, open interest from OCC. Cboe has blocked apps from its free delayed quotes since Nov 20, 2026, so without Schwab NDX stays unavailable; QQQ tracks the same index. See Data sources.

Quick start · Releases · Privacy

What this is not: Not financial advice. Not a signal service. The trade guidance is the textbook dealer-gamma reading of a model, untested, and says so on screen. Every screenshot below is synthetic demo data, not live market data.

The live map for SPY on synthetic demo data: GEX by strike, the call wall, the put wall, the gamma flip and the trade guidance panel

Watch: I Built a Free Gamma Exposure (GEX) Map You Can Understand

I Built a Free Gamma Exposure (GEX) Map You Can Understand: what GEX is and how traders use it, then the tool itself on demo data.

Privacy and your data

Edge GEX Lab runs on your own computer. It needs no account, sends no telemetry, and the server listens on 127.0.0.1 only.

What stays local

  • Your Alpaca keys, in .env next to this README. They are read, never copied or logged.
  • Optional Schwab keys, in the same .env, and the Schwab sign-in in ~/.schwabdev/edge-gex-lab.db (or, when the keys come from Edge Trader's .env through SCHWAB_ENV_FILE, the sign-in that app already keeps in ~/.schwabdev/tokens.db; SCHWAB_TOKENS_DB moves it).
  • Small caches (option chains, the exchange calendar, daily volume) in data/, which is not part of the repo.

External services

Alpaca (your account, REST only): stock trades and daily bars for the spot price and volume, option contracts and option quotes, SPX included. It receives your API keys and the tickers you open. It never receives an order: the app calls no trading endpoint and never opens a websocket.

OCC (the options clearing house, public, no account): open interest by contract for every map, from marketdata.theocc.com, the script address OCC documents for its reports. It receives the ticker you open and the app's name and version. Downloaded at most once per ticker per 30 minutes. OCC's terms allow no commercial use; you download it yourself, for personal research. If OCC is unavailable the map falls back to Alpaca open interest and says so.

Schwab (optional, your account, REST only): only when you set Schwab keys and sign in. Real-time SPX and NDX option chains from api.schwabapi.com, plus the sign-in itself. It receives your app key, your sign-in and the index you open. The app reads market data only: it calls no account or trading endpoint and never opens Schwab's streamer.

Cboe delayed quotes (public, no account): the NDX option chain when Schwab is not connected, from cdn.cboe.com. It receives the ticker you open. Since Nov 20, 2026 Cboe answers these requests with a block page, so NDX needs Schwab. The app does not try to get around the block. Cboe's site terms restrict automated use of these pages: you fetch them yourself, for personal research, at your own risk. Do not redistribute the data.

Your local claude CLI (optional): only when you press "Explain this map". It receives the guidance object for that map and nothing else, runs with every tool, MCP server and setting disabled, and gets no API key from this app.

GitHub (update check): when the server starts, at most once a day, it asks api.github.com for this repo's latest release. GitHub sees your IP address and the app version, nothing else: no keys, no tickers, no settings. If a newer version exists, a banner on the page and a line in the launch.bat window link to the release notes; nothing is downloaded or installed. It is silent when you are offline, demo mode never checks, and set GEXLAB_NO_UPDATE_CHECK=1 before launch.bat turns it off.

API keys

Keys live in .env on your machine, which is never committed. Do not share or commit .env files, caches or screenshots with your account details.

What's inside

  • Live map: net GEX by strike (signed, or unsigned by size), the call and put walls, every gamma flip within 10% of spot, a hypothetical net GEX curve, an expiry picker (opens on the nearest expiry), refreshed every 60 seconds and valued at the session close when the market is shut. Tickers you search stay as one-click chips beside the search box (the last 6, kept in your browser).
  • Net GEX size: net and gross GEX per 1% move and per typical day (14-session ATR), as a share of the ticker's 20-day average dollar volume. Indexes show none: their hedging trades mostly in futures.
  • Trade guidance: the environment (trend in negative gamma, mean reversion in positive gamma, mixed when influence is low), levels to watch with distance from spot, 2 to 4 scenarios with entry, stop and map-level targets (reward at least equal to risk), what would change the picture, and the formula behind every computed price. No setups on a stale feed, old open interest, or a chain missing too much of its gamma.
  • Coverage you can see: the share of the estimated |GEX| within 5% of spot held by contracts with usable open interest and IV, and how many contracts were left out and why.
  • Futures view: the same levels as /ES or /MNQ equivalents for SPX, NDX, SPY and QQQ, with the basis estimated from the option chain. See Futures view.
  • Vol drift and DEX: whether at-the-money implied volatility is rising or falling since the session began, and the size of call and put delta exposure from open interest. Context only, labeled untested. See Vol drift and DEX.
  • Present mode (key P): a larger layout for screen recording.

Screenshots

Live map. GEX by strike around spot, with the walls and the gamma flip marked and the method drawer one click away. Synthetic demo data.

Live map on synthetic data

Trade guidance. Levels to watch, scenarios with entry, stop and targets, and the regime change triggers, each price traceable to the map. Synthetic demo data. For education only, not financial advice.

Trade guidance panel on synthetic data

Quick start

Requirements: Python 3.11 or newer, Node.js LTS, and an Alpaca account for its free API keys (every map needs them).

Windows, two steps: download or clone the repo, then double-click

  1. setup.bat, once. It installs everything, builds the web page and creates .env for your keys. Open .env and paste your Alpaca key and secret.
  2. launch.bat, every time. It opens http://127.0.0.1:8240.

Try it first with no keys and no network: launch.bat demo (or set GEXLAB_DEMO=1 before starting the server) serves synthetic fixtures for SPY, QQQ, SPX, NDX and NVDA. Every screen carries a "Synthetic fixture" badge, nothing in it is market data, and it writes only to data/gexlab_demo.db, so your real install stays empty. Close the window and run launch.bat to switch to your own data.

Manual setup (Mac, Linux, or if you prefer):

python -m venv .venv
.venv/bin/python -m pip install -r requirements.txt     # Windows: .venv\Scripts\python
cp .env.example .env                                     # then add your Alpaca keys
cd web && npm ci && npm run build && cd ..
.venv/bin/python -m uvicorn gexlab.api:app --host 127.0.0.1 --port 8240

Install with an AI coding assistant: if you use one (Claude Code, Codex, Cursor or similar), open it in an empty folder and paste this prompt:

Install Edge GEX Lab on this computer from github.com/simonro/Edge-GEX-Lab. Follow the README Quick start
exactly. First check that Python 3.11+ and Node.js LTS are installed, and if one is missing, tell me
instead of installing it. Then run the setup, start the app and confirm http://127.0.0.1:8240 opens.
Do not add any API keys. Show me where the .env file is so I can paste my own Alpaca keys.

Every install starts empty: no saved maps and no history. Open the page, pick a ticker, and the map loads from your own data feed.

If the web build fails on Windows with "An Application Control policy has blocked this file": that is Smart App Control blocking a native build helper. The project builds with the WebAssembly version of Rollup to avoid it, so delete web\node_modules and run setup.bat again.

Updating to a new release

Your keys (.env) and caches (data/) are not part of a release, so an update never touches them. When a new release is out, the app tells you with a banner at the top of the page (once a day, see Privacy above), linking to its release notes.

If you cloned with git: git pull, then setup.bat (it rebuilds the page), then launch.bat.

If you downloaded the ZIP: unzip the new version into a new folder, copy .env across, run setup.bat once, then launch.bat.

Configuration

Variable Enables
APCA_API_KEY_ID, APCA_API_SECRET_KEY Every map: SPY, QQQ, SPX and stocks (Alpaca quotes, spot and volume).
ALPACA_MODE paper (default) or live: which Alpaca account the keys belong to. Market data is the same.
ALPACA_ENV_FILE (environment variable, not .env) Optional path to a .env file somewhere else that already holds your Alpaca keys, used instead of the .env next to this README. Keys set directly as environment variables win over both.
SCHWAB_APP_KEY, SCHWAB_APP_SECRET, SCHWAB_CALLBACK_URL Optional: real-time SPX and NDX from Schwab (see Data sources). The callback must match your Schwab app exactly, https://127.0.0.1 by default.
SCHWAB_ENV_FILE (.env or environment variable) Optional path to another app's .env that already holds Schwab keys (Edge Trader for Schwab's, for example). Used only when this .env sets no SCHWAB_APP_KEY; then the keys, callback and sign-in file all come from that file (or environment variables), never from this .env.
SCHWAB_TOKENS_DB (.env or environment variable) Where the Schwab sign-in lives. Default: ~/.schwabdev/edge-gex-lab.db for keys set here, or ~/.schwabdev/tokens.db (shared with Edge Trader) for keys from SCHWAB_ENV_FILE. With shared keys, set it in that app's .env or as an environment variable. Two different Schwab apps must never share one file: a sign-in replaces the file's only entry.
GEXLAB_SCHWAB (environment variable, not .env) 0 turns the Schwab source off even when keys are set.
GEXLAB_SCHWAB_TICKERS (environment variable, not .env) Which indexes the live map takes from Schwab, SPX,NDX by default (indexes only).
GEXLAB_PORT (environment variable, not .env) Port for launch.bat and the web dev server's proxy, 8240 by default. Example: set GEXLAB_PORT=8250 then launch.bat. For the manual start, pass the same number to --port.
GEXLAB_NO_BROWSER (environment variable, not .env) 1 stops launch.bat from opening your browser.
GEXLAB_NO_UPDATE_CHECK (environment variable, not .env) 1 turns off the once-a-day check for a new release on GitHub.
GEXLAB_DEMO (environment variable, not .env) 1 serves the synthetic demo fixtures, the same as launch.bat demo.
GEXLAB_RECAP_MODEL (environment variable, not .env) Optional model name passed to your claude CLI for "Explain this map".

How it works

  • GEX per contract = sign x gamma x open interest x 100 x spot squared x 0.01: dollars of dealer delta change per 1% move. Gamma is Black-Scholes with r = q = 0, a stated approximation.
  • The sign is an assumption. Calls count as positive gamma and puts as negative (dealers long calls, short puts). Real positioning is not public; the unsigned view drops the assumption.
  • Open interest is daily and one session behind for every tool, because OCC publishes it once a day. Since v1.3.1 it comes straight from OCC, joined to Alpaca's contracts by OCC symbol (before, from Cboe's payload, which now blocks apps). OCC prints no date, so the date is inferred: Alpaca's when the numbers match Alpaca's, otherwise the session before the download day, and one session earlier for a download before 07:00 ET. If OCC is unavailable the map falls back to Alpaca open interest, which usually runs one session older still, and says so. The OI date is on the map.
  • Feeds. Alpaca OPRA (paid) gives live quotes and the IV is solved from the mid; Alpaca's free indicative feed gives a modified quote with its own IV. Alpaca computes no IV for contracts that expire today, so on the free feed the app solves those from the indicative mid the same way it does on OPRA. Checked side by side against OPRA on SPY and QQQ through a session, the walls matched and the flip stayed within 0.25% of spot, but net GEX for today's expiry was off by as much as half. Trust the levels on the free feed more than the bar sizes. SPX works differently, see SPX on Alpaca. The map labels which feed you are looking at.
  • Valuation clock. Time to expiry is measured from the quote time, and from the session close when the market is shut, so a weekend map is not distorted.

Data sources

Click Data sources in the top bar to see which source serves each ticker right now, what each source unlocks, whether it is connected, and how to connect it.

Source You need Unlocks Delay Cost
Alpaca (required) A free Alpaca account and its API keys SPY, QQQ, stocks, SPX 15 min on the free plan, real time on OPRA Free, OPRA plan paid
Schwab (optional) A Schwab brokerage account and a Schwab developer app Real-time SPX and NDX Real time Free with the account
OCC (automatic) Nothing Open interest for Alpaca chains Prior session Free
Cboe (automatic) Nothing NDX when Schwab is off (blocked since Nov 20, 2026) About 15 min Free

The live map uses Schwab for SPX and NDX whenever it is connected, and falls back to Alpaca (SPX) or Cboe (NDX) when it is not, saying so on the map. SPX has two working sources, so its row in the panel has a picker: Auto (Schwab while connected, the default), Schwab or Alpaca. The lab saves the choice, and the map switches at once.

Connect Schwab (optional)

  1. At developer.schwab.com (a separate login from your brokerage account), create an app with the Market Data Production product and the callback URL https://127.0.0.1.
  2. Wait until its status reads Ready For Use. "Approved - Pending" is not enough, and this can take a few days.
  3. Put the app key and secret in .env as SCHWAB_APP_KEY and SCHWAB_APP_SECRET, then restart the lab.
  4. Open Data sources, click Open Schwab sign-in, sign in and approve the app. Schwab then sends the tab to an address that does not load. That is expected: copy the whole address and paste it into the panel within about 30 seconds.

Schwab asks for this sign-in again every 7 days. Two days before it ends, the Data sources badge turns amber and a banner offers the sign-in; until you renew, SPX and NDX use the fallback sources. For safety the sign-in works only from the computer that runs the lab; on a headless server, reach the lab through an SSH tunnel.

Already use Edge Trader for Schwab? Set SCHWAB_ENV_FILE to its .env and both apps share one Schwab app and one weekly sign-in. Schwab chains include their own open interest: on Nov 30, 2026 it matched OCC's file on every one of 3,946 SPX and 4,552 NDX contracts, and the SPX walls matched the Alpaca map. NDX open interest is thin near the money (tens of contracts per strike), so a single large position can set its walls; QQQ carries most of the Nasdaq 100's option gamma.

The Schwab sign-in and API calls are built on Schwabdev (MIT). The recorder and the studies never use Schwab: their sources stay fixed whatever you connect.

thinkorswim levels (TOS button)

The TOS button next to Index / Futures copies a thinkScript study with today's 0DTE call wall, put wall and gamma flip. In thinkorswim open Studies, Edit studies, Create, paste it over the template, name it and click OK. During market hours the lab logs each level whenever it changes, so the study shows where each level started (cyan) and every move after that (call wall green, put wall magenta, flip yellow). thinkorswim cannot read outside data, so the lines do not move by themselves: click TOS again and paste over the study to update it. With the Futures view on, the levels come in /ES or /NQ prices.

SPX on Alpaca

Until Nov 19, 2026 SPX and NDX came from Cboe's free delayed quotes. Cboe now blocks apps from that feed, so since v1.3.0 SPX comes from Alpaca, which lists SPX index options (the AM settled monthlies and the SPXW weeklies) with the same OCC open interest: 14 of 14 contracts checked matched Cboe exactly.

  • Spot. Alpaca publishes no SPX level, so it is read from the options by put-call parity: strike + call minus put, the median of the 6 strikes nearest the money at the nearest expiry. It is live, not 15 minutes old, and the map labels it "from SPX options (put-call parity)".
  • IV on the free feed. Alpaca gives no usable IV for index options, so every IV is solved from the quote mid. Checked against OPRA over 4 rounds on Nov 20, 2026: the same call and put walls every round, net GEX within 3.5% and spot within 1.5 points. The free feed's quotes are widened, so trust the walls and the gamma sign more than the exact bar sizes.
  • NDX is not on Alpaca. Connect Schwab for a real-time NDX map; without it the map shows that Cboe blocks NDX. QQQ tracks the same index.
  • Keys. SPX now needs your Alpaca keys, like every other map.

Futures view

Since Nov 20, 2026 (Cboe's block): SPX and SPY take the basis from Alpaca, the live SPX parity spot and Alpaca quotes for the AM options that settle the contract, so nothing below is delayed. NDX and QQQ (/NQ, /MNQ) are unavailable: they need an NDX value and NDX options, which no free source carries now.

If you trade /ES or /MNQ, flip the Live Map's Index | Futures toggle and every level reads as a futures price: the level cards show the futures value large with the index or ETF value underneath, the chart tags read like "CALL WALL /ES 7,791.00", and the guidance prices convert too. It is a display change only: the GEX math stays in index or ETF units, and the panel labels the result an estimate, not a futures quote.

  • Which contract. SPX maps to /ES (and /MES), NDX to /MNQ (and /NQ). The view uses the front quarterly contract (Mar, Jun, Sep, Dec) and moves to the next one on CME's customary roll date, the Monday before the third Friday.
  • Where the basis comes from. Put-call parity on the AM settled index options that expire with the futures: forward = strike + e^(rT) x (call mid minus put mid), taken as the median over the strikes nearest the forward. The basis is that forward minus the index value from the same Cboe payload, so the 15 minute delay cancels out. No futures feed and no extra account. With fewer than 3 usable strike pairs the view says it is unavailable instead of guessing.
  • SPY and QQQ convert to index points first, by the index to ETF price ratio at the same instant (the Cboe index value and the last ETF trade at or before that second, from Alpaca). That needs your Alpaca keys; without them the SPY and QQQ futures view is unavailable, like their maps.
  • Your own price. Type the live futures price you see into the panel and the basis becomes that price minus the latest index value. When it differs from the parity estimate by more than 3 points on /ES (12 on /MNQ), the panel warns.
  • Rounding. Futures = level x ratio + basis, rounded to the contract's 0.25 tick. The ratio is 1 for SPX and NDX.

Works in demo mode on synthetic data, labeled as such. Not financial advice.

Vol drift and DEX

Two context readings on the Live Map. Neither changes the GEX math, the levels or the guidance, and neither is tested: both carry an Untested chip.

  • Vol drift answers one question: is at-the-money implied volatility rising or falling today? It reads the ATM IV of one expiry (the IVs of the two strikes around spot, interpolated to spot) and compares it with the session's first reading after the open. The expiry is the nearest one with at least 3 full trading days left, fixed for the whole session and never 0DTE, so the reference and the current value measure the same contracts. The change counts as flat while it is smaller than max(0.5 vol points, 5% of the reference IV); beyond that it reads rising or falling. The card pairs it with the gamma regime as the conditions where moves tend to get bigger (rising IV in negative gamma) or stay smaller (falling IV in positive gamma). A ticker that lists only Friday expiries can read unavailable late in the week, when no expiry in the 7 day window has 3 full sessions left.
  • DEX is delta exposure: delta x open interest x 100 x spot, summed per side. Net DEX is call delta exposure minus put delta exposure, so it reads positive when calls are larger and negative when puts are, with each side's size shown unsigned. Open interest is the previous session's, so DEX sizes yesterday's positioning at today's price and IV. It is not a live flow scoreboard.

Not financial advice.

Contributing

Bug reports and pull requests are welcome. CONTRIBUTING.md covers setup, tests and what a change needs. Please report security problems privately, as described in SECURITY.md, not in a public issue.

More free tools from Tape to Edge

Same rules for each one: free, MIT, runs on your own machine, and the build is on the YouTube channel.

  • Edge Scanner: a real-time intraday stock scanner with a browser dashboard you lay out yourself.
  • Trading Journal AI: a local-first journal. Import your broker CSV, get round-trip trades, KPIs and AI diary analysis.
  • AI Research Desk: three AI research teams debate one stock into swing and long-term calls.

Who made this

I'm Simon, a trader who builds his own tools and films the process on Tape to Edge. This is the live map from my GEX research lab; the evidence side (frozen 10:00 levels, replays and pre-registered studies of whether the levels matter) stays private until it has enough sessions to say something.

I take no affiliate money from any tool I show, and this project has no paid tier, no account and no telemetry. If it is useful, fork it.

License

MIT. See LICENSE. Charts use TradingView Lightweight Charts (Apache 2.0).

About

A free, local live map of option gamma exposure (GEX) for SPY, QQQ, SPX, NDX and stocks: walls, gamma flip, regime, size and trade guidance. Not financial advice.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

81 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages