A web dashboard that pulls IBIT (iShares Bitcoin Trust ETF) options chain data from Yahoo Finance, calculates Gamma Exposure (GEX) using Black-Scholes, and displays actionable trading levels for BTC perpetual futures trading with leverage.
The core thesis: IBIT options flow creates dealer hedging dynamics that produce support/resistance levels in BTC. When the gamma regime is positive, BTC is range-bound and you can fade the extremes on perps. When negative, ranges break and you should trade momentum or sit out.
If you're unfamiliar with options, here's what you need to know to use this dashboard.
Options are contracts that give the buyer the right to buy (call) or sell (put) an asset at a specific price (strike) by a specific date (expiration). When you buy an option, someone sells it to you — usually a market maker (dealer).
Dealers don't want directional risk. When a dealer sells you a call option, they're exposed if the price goes up. So they buy some of the underlying asset to offset that risk. This is called delta hedging. As price moves, dealers constantly adjust their hedges — buying and selling the underlying — which creates real supply and demand in the market.
Open Interest (OI) is the number of active option contracts at a given strike. High OI = lots of hedging activity at that price level. These strikes act like magnets or walls because of the hedging flows around them.
The Black-Scholes model produces several sensitivity measures called "Greeks":
- Delta — How much the option price moves per $1 move in the underlying. Dealers hedge delta, so a strike with lots of OI and high delta means dealers are buying/selling a lot of stock there.
- Gamma — How fast delta changes as price moves. High gamma near a strike means dealers need to aggressively rebalance as price approaches it. This is why GEX levels act as support/resistance.
- Vanna — How delta changes when implied volatility (IV) moves. When IV drops (vol crush), dealers with positive vanna exposure must buy; when IV spikes, they must sell. This creates directional flows purely from volatility changes.
- Charm — How delta decays over time. Even if price and IV don't move, dealers must rebalance overnight because their delta exposure drifts as options get closer to expiration. This creates predictable overnight flows.
IBIT is a Bitcoin ETF with a large, liquid options market. When dealers hedge IBIT options, they're effectively creating supply/demand at specific BTC price levels. A strike with massive call open interest at $60 IBIT translates to a resistance zone in BTC at the equivalent price. The hedging flows are mechanical — dealers don't have a view, they just follow their risk models. This makes the levels predictable and tradeable.
pip install -r requirements.txt
cp .env.example .env # add your Anthropic API key
python3 app.pyOpen http://localhost:5000 in your browser.
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
For AI analysis | Claude API key for automated trading analysis |
Create a .env file in the project root (loaded automatically via python-dotenv).
# Default: port 5000
python3 app.py
# Custom port and host
python3 app.py --port 8080 --host 0.0.0.0DTE (days to expiration) is selectable from the web UI dropdown (3d, 7d, 14d, 30d, 45d).
| Flag | Default | Description |
|---|---|---|
--port, -p |
5000 | Server port |
--host |
127.0.0.1 | Server host (use 0.0.0.0 for WSL2) |
BTC price, IBIT price, gamma regime badge, timestamp, DTE selector, candle timeframe selector (15m/1h/4h/1d), expiration date, refresh button.
BTC candles (via Binance) with horizontal overlays at call wall, put wall, gamma flip, max pain, expected move bounds, and support/resistance levels. Timeframe is selectable from the header.
Bar chart of net gamma exposure at each strike. Green = positive gamma (dealers dampen moves), red = negative gamma (dealers amplify moves).
Call vs put open interest at each strike, showing where hedging activity is concentrated.
- AI Analysis — Claude-powered trading analysis across all DTE timeframes (3d/7d/14d/30d/45d + combined). Auto-runs daily when fresh data arrives. Includes day-over-day level changes and prior analysis context for thesis continuity.
- Regime Banner — Positive gamma (range-bound, fade extremes) or negative gamma (trending, don't fade)
- Expected Move — Implied straddle range for nearest expiry
- Range Visual — In positive gamma: tradeable range between put wall and call wall with spot indicator
- Key Levels — Call Wall, Put Wall, Gamma Flip, Max Pain with BTC prices and distance from spot
- Significant Levels — High-OI strikes with regime-adjusted behavior, OI changes (BUILDING/DECAYING), and vanna/charm notes
- Breakout Assessment — Upside/downside signal scoring with targets
- Dealer Flows — Overnight charm forecast, vanna vol scenarios, and combined overnight dealer rebalancing estimate
- OI Changes — Call/put open interest shifts vs prior snapshot
- Dealer Position — Net GEX, dealer delta, net vanna, net charm, put/call ratio
- History — Daily snapshots of regime and levels
- Fetches IBIT spot price and BTC-USD price from Yahoo Finance
- Auto-calculates BTC/Share ratio (IBIT price / BTC price)
- Pulls options chains across expirations within the DTE window
- Calculates Black-Scholes gamma, delta, vanna, and charm using per-strike implied volatility
- Aggregates to build a GEX profile, derive levels, and compute dealer flow forecasts
Options OI updates once per day (after market close). The app caches the full computed result in SQLite per DTE. On subsequent loads it compares OI to detect when Yahoo has fresh data — if unchanged, the cache is served instantly. Yahoo is re-checked at most every 30 minutes until new data is confirmed.
A background thread pre-fetches all 5 DTE timeframes on startup and keeps the cache warm. Once all timeframes are fresh for the day, it auto-runs AI analysis (if ANTHROPIC_API_KEY is set).
GEX = Gamma x OI x 100 x Spot^2 x 0.01
- Call GEX = positive (dealers short calls -> buy dips / sell rips)
- Put GEX = negative (dealers short puts -> sell dips / buy rips)
- Net GEX at each strike = Call GEX + Put GEX
- Call Wall: Strike with highest call GEX (resistance)
- Put Wall: Strike with most negative put GEX (support)
- Gamma Flip: Where net GEX crosses zero (regime change point)
- Max Pain: Strike minimizing total option payout — if the underlying settled here at expiration, option holders would lose the most. Acts as gravitational pull into expiry, strongest in positive gamma.
- Expected Move: ATM straddle price from nearest expiration. Represents the market's priced-in 1-standard-deviation range (~68% probability).
- S1/S2, R1/R2: High-OI support and resistance strikes beyond the walls. These are secondary levels where dealer hedging creates friction.
Local net GEX around spot (+/-2% of IBIT price):
- Positive Gamma: Dealers hedge against moves. Mean-reversion, range-bound. Fade extremes.
- Negative Gamma: Dealers hedge with moves. Momentum, trend extension. Don't fade.
The same level behaves differently depending on regime:
- Positive gamma + put wall = "HARD FLOOR" (dealers buy the dip)
- Negative gamma + put wall = "REACTION" (dealers sell into the bounce, floor can break)
- Positive gamma + call wall = "HARD CEILING" (dealers sell into the rally)
- Negative gamma + call wall = "REACTION" (brief cap, watch for squeeze through)
Beyond gamma, the dashboard forecasts dealer flows from two additional Greeks:
Charm (overnight delta decay): Every night, dealers' delta exposure drifts as options decay. The dashboard calculates the net shares dealers must trade overnight to stay hedged. Positive charm = dealers buy tomorrow, negative = dealers sell.
Vanna (vol-dependent flows): When IV changes, dealer delta shifts. The dashboard models two scenarios:
- Vol crush (-5pts IV): In calm/rallying markets, IV tends to fall. Dealers with positive vanna exposure must buy.
- Vol spike (+5pts IV): In selloffs, IV rises. Dealers with negative vanna exposure must sell, accelerating the move.
Combined overnight: The dashboard estimates net overnight flow by combining charm with expected vol decay (~0.5pt per calm session).
| Signal | Bullish | Bearish |
|---|---|---|
| Wall asymmetry | Call wall GEX < 0.5x put wall | Put wall GEX < 0.5x call wall |
| Wall decay | Call wall OI declining >10% | Put wall OI declining >10% |
| Expected move vs range | Straddle width > wall range | Same |
| Negative gamma + proximity | Near call wall = squeeze | Near put wall = waterfall |
| OI beyond walls | >40% call OI above call wall | >40% put OI below put wall |
| P/C ratio extremes | P/C > 1.5 = squeeze fuel | P/C < 0.6 = call skew unwind |
Lower DTE (7) focuses on near-term expirations where gamma is strongest (gamma scales as 1/sqrt(T)). Higher DTE (14-45) includes longer-dated positioning which is structurally relevant but has less gamma impact. Default is 7 for short-term trading. DTE is selectable from the web UI dropdown.
Snapshots are stored in SQLite (~/.ibit_gex_history.db). The dashboard compares against the previous day's snapshot:
- Aggregate OI changes with positioning interpretation
- Per-level OI deltas (BUILDING / DECAYING)
- Historical regime and level trends
The database also stores full data caches (per DTE) and AI analysis results, both keyed by date.
Returns JSON with spot prices, levels, GEX/OI chart data, significant levels, breakout assessment, dealer flow forecast, OI changes, and history. Served from cache when available.
Accepts ?dte=N query parameter (1-90) to override the DTE window.
Returns the cached AI analysis for today, or {"status": "pending"} if not yet generated.
Force re-run AI analysis across all DTE timeframes. Returns the analysis JSON directly. Requires ANTHROPIC_API_KEY.
| Constant | Default | Purpose |
|---|---|---|
RISK_FREE_RATE |
13-week T-bill (^IRX) | Fetched daily from Yahoo Finance, falls back to 4.3% |
BTC_PER_SHARE |
0.000568 | Fallback — auto-calculated from live prices |
STRIKE_RANGE_PCT |
0.35 | Filter strikes to +/-35% of spot |
- Yahoo Finance OI updates once daily (after market close), not intraday
- Assumes dealers are net short all options (standard but not always true)
- BTC/Share ratio auto-calculated from spot; actual NAV drifts slightly due to fees
- Vanna/charm magnitudes are estimates — actual dealer positioning depends on their book, which isn't public
- AI analysis requires an Anthropic API key and uses Claude Opus (~$0.15/day)