Real-time intraday analytics for zero days to expiration (0DTE) options using the FlashAlpha API. This repository contains working Python examples, theory explainers, and test suites covering 0DTE gamma exposure, pin risk, expected move, dealer hedging flows, theta decay, and trading strategies.
Keywords: 0dte options python, 0dte pin risk, 0dte gamma exposure, zero dte options analytics, 0dte trading strategies python, 0dte expected move, same day options.
Zero days to expiration (0DTE) options expire on the same calendar day they are traded. SPY and QQQ now have options expiring every Monday, Wednesday, and Friday. SPX has options expiring every weekday. This means traders can buy or sell options that expire within hours — sometimes within minutes — of placing the trade.
0DTE options have grown from a niche instrument into roughly 40-50 percent of total SPX options volume on active days. Their explosive growth is driven by:
- Low premium cost — a short-dated ATM option may cost $1-3 vs. $10-20 for a weekly
- Defined risk — buyers cannot lose more than the premium paid
- High gamma — small moves in the underlying produce large moves in the option price
- Daily settlement — no overnight risk for option buyers
Because 0DTE options have such short lifetimes, their behavior is dominated by gamma and theta in ways that longer-dated options are not. Understanding these mechanics is essential before trading them.
Gamma exposure (GEX) measures how much dealers must buy or sell the underlying as price moves. When dealers are short gamma (net negative GEX), they must buy as price rises and sell as price falls — amplifying moves. When dealers are long gamma (net positive GEX), they do the opposite — dampening moves and creating range-bound conditions.
0DTE options contribute disproportionately to intraday GEX because gamma is highest for near-the-money options approaching expiration. A 0DTE ATM option can have 5-10x the gamma of an equivalent 7DTE option at the same strike. This means dealer hedging from 0DTE positions creates strong gravitational forces on price throughout the day.
The gamma flip is the price level where net dealer GEX transitions from positive to negative. Above the flip, dealers are typically long gamma and dampen volatility. Below the flip, dealers are short gamma and amplify it.
Pin risk describes the tendency of an underlying to "pin" to a heavily concentrated open interest (OI) strike near expiration. The mechanism works as follows:
- Large OI builds at a specific strike — e.g., 500,000 contracts at SPY 595 calls
- As expiration approaches, dealers who are short those calls hold negative delta at the strike (they must buy SPY to hedge when SPY is above 595, sell when below)
- This creates a zone of support just below 595 (dealers buy) and resistance just above (dealers sell), pulling price toward the strike like a magnet
Pin risk is highest when:
- A single strike holds a large share of total 0DTE OI
- The underlying is within 0.5% of that strike
- Less than 2 hours remain until expiration
The FlashAlpha API returns a pin_score (0-100) measuring the strength of this effect,
a magnet_strike identifying the most likely pin level, and max_pain identifying the
strike where the total value of expiring options is minimized.
The expected move for a 0DTE option is derived from the ATM straddle price. If an ATM straddle (call + put at the same strike) costs $3.50, the market implies a one standard deviation range of approximately ±$3.50 from the current price by end of day.
More precisely, the 1SD expected move = straddle price × 0.6827 (the probability that a normally distributed variable falls within ±1 SD). In practice, the straddle price itself is used as the ±1SD range because it is the simplest and most liquid estimate.
As the day progresses, the remaining expected move shrinks with the square root of
remaining time. If 4 hours remain out of a 6.5-hour session, roughly 78% of the day's
expected move remains (sqrt(4/6.5) ≈ 0.78). The FlashAlpha API computes this
remaining_1sd value in real time, allowing traders to compare current displacement
to the remaining implied range.
Dealers (market makers) who sell options must delta-hedge their books continuously. As price moves, their delta changes and they must transact in the underlying to stay neutral. This creates predictable flows:
- At +0.5% from spot: dealers long gamma must sell, dealers short gamma must sell more
- At -0.5% from spot: dealers long gamma must buy, dealers short gamma must buy less
The FlashAlpha API estimates the total number of shares dealers would need to buy or sell at various price displacements. These flows create natural support and resistance zones that technically-oriented 0DTE traders use for entry and exit timing.
Every FlashAlpha API response carries data_as_of, reporting when each upstream feed last
delivered to the node that answered, plus endpoint_version identifying the deployment
that produced it.
"endpoint_version": "2026.08.25",
"data_as_of": {
"node": "fa2",
"equity_feed": "2026-08-25T18:48:58.204Z",
"equity_options_feed": "2026-08-25T18:48:57.900Z",
"index_feed": null,
"index_options_feed": null,
"futures_feed": null,
"futures_options_feed": null,
"flow_feed": "2026-08-25T18:48:55.100Z",
"oi_feed": "2026-08-24T20:00:00.000Z",
"macro_feed": "2026-08-25T18:45:00.000Z"
}Spot and options are reported separately because they arrive over different pipes and fail independently - an index chain can be current while the index level behind it is not, and one timestamp cannot express that.
Read each feed against its own cadence, not against as_of. oi_feed at the previous
session's close is correct: settled open interest is published once per session, so on a
Monday the newest figure that exists is Friday's. An options feed an hour behind during
the regular session is not correct. A null means that node has not seen that feed, not
that it is broken.
The field evidences that a feed delivered recently. It does not assert that every contract in a chain is equally current: an illiquid strike may not have quoted for hours while its feed is healthy.
Full reference: https://flashalpha.com/docs/lab-api-overview#response-envelope
These are the live, simulation-aware FlashAlpha endpoints that power same-day 0DTE (zero days to expiration) options analytics — intraday gamma exposure, pin risk, gamma magnet, dealer hedge flow, time-to-close theta/charm decay, and expected move. Use them to build real-time 0DTE dashboards, intraday SPY/SPX/QQQ scanners, and dealer-positioning trading signals.
| Endpoint | What it returns |
|---|---|
GET /v1/exposure/zero-dte/{symbol} |
Full 0DTE exposure sheet: gamma regime and gamma-flip distance, pin risk and gamma-magnet strike, expected move, dealer hedging buckets at ±10bp / ±25bp / ±50bp / ±1%, time-to-close theta/charm decay, and per-strike breakdown. Pass the new optional expiry param to pull 1DTE, 2DTE, or any same-week expiry through the same zero days to expiration selector. |
GET /v1/flow/zero-dte/snapshot/{symbol} |
Live, simulation-aware 0DTE snapshot on effective open interest — the same shape as the exposure sheet plus a flow_direction block showing whether intraday dealer flow is amplifying or dampening net gamma since the open. |
GET /v1/flow/zero-dte/series/{symbol} |
Intraday 0DTE time series (30s/1m/5m/15m bars) of net GEX/DEX, gamma flip, walls, gamma magnet, pin score, ATM IV, and charm — ready for charting how today's zero-DTE dealer positioning evolves into the close. |
GET /v1/flow/zero-dte/hedge-flow/{symbol} |
Cumulative dealer hedge-flow time series (calls / puts / all) — the signed shares and notional market makers transact intraday to stay delta-neutral as spot drifts toward the 0DTE gamma magnet. |
GET /v1/flow/zero-dte/heatmap/{symbol} |
Strike × time heatmap of 0DTE GEX/DEX/VEX/CHEX/OI or signed aggressor flow (raw or delta mode) — visualize where intraday dealer gamma and option flow concentrate across the session. |
GET /v1/flow/zero-dte/strike-flow/{symbol} |
Per-strike signed aggressor flow for today's 0DTE chain — see exactly which strikes are absorbing intraday buying vs. selling pressure and where pin risk is building. |
GET /v1/strategies/zero-dte/{symbol} |
Same-day 0DTE strategy signal (range-compression / iron-fly) with a decision verdict, sized from live pin risk, expected move, and dealer gamma regime. |
GET /v1/flow/pin-risk/{symbol} |
Live pin-risk score, magnet strike, and max pain for the underlying — the real-time gamma-magnet read that drives end-of-day 0DTE pinning. |
Keywords: 0dte options API, zero days to expiration analytics, 0dte pin risk endpoint, gamma magnet, intraday dealer hedging flow, time-to-close decay, charm decay, expected move, 0dte gamma exposure, SPY SPX QQQ 0dte, same-day iron fly signal.
Run these at full-universe scale with point-in-time history on the Alpha tier: flashalpha.com/for-quant-teams
pip install flashalphaimport os
from flashalpha import FlashAlpha
fa = FlashAlpha(os.environ["FLASHALPHA_API_KEY"])
data = fa.zero_dte("SPY")
print(data["regime"]["label"]) # e.g. "positive_gamma"
print(data["pin_risk"]["pin_score"]) # 0-100
print(data["expected_move"]["remaining_1sd"]) # intraday remaining moveGet a free API key at flashalpha.com — no credit card required.
| File | Description |
|---|---|
| examples/0dte_pin_risk_analysis.py | Analyze pin risk: pin score, magnet strike, OI concentration, max pain |
| examples/0dte_expected_move_calculator.py | Calculate full-day and remaining intraday expected move |
| examples/0dte_gamma_regime_tracker.py | Track gamma regime: flip level, positive/negative gamma implications |
| examples/0dte_dealer_hedging_flows.py | Estimate dealer share flows at various price displacements |
| examples/0dte_theta_decay_monitor.py | Monitor theta decay, charm regime, gamma acceleration near close |
| examples/0dte_spy_intraday_playbook.py | Complete intraday report: regime, expected move, pin risk, hedging, decay |
| examples/0dte_trading_strategies.py | 5 common 0DTE strategies with API data to inform each |
| examples/0dte_vol_context_analysis.py | Vol context: 0DTE/7DTE IV ratio, VIX, vanna exposure |
| File | Description |
|---|---|
| theory/what_is_0dte.md | What are 0DTE options, why they've grown, SPY/SPX schedule |
| theory/pin_risk_mechanics.md | Detailed pin risk mechanics and OI concentration |
| theory/gamma_acceleration.md | Why gamma accelerates near expiration and the math behind it |
- 0DTE Gamma Exposure and Pin Risk: Intraday Options Analytics
- 0DTE SPY Complete Intraday Playbook: Same-Day Options
- Guide to 0DTE Trading Strategies with Real-Time Data
- Zero-DTE API: Complete Guide to the 0DTE Analytics Endpoint
- Zero-DTE Options API: Real-Time 0DTE Analytics
Install the official Python SDK: pip install flashalpha
Full SDK documentation and API reference: flashalpha.com
GitHub: github.com/FlashAlpha-lab/flashalpha-python
- FlashAlpha Python SDK —
pip install flashalpha - GEX Explained — gamma exposure theory and code
- Volatility Surface Python — SVI, variance swap, skew analysis
- Examples — more tutorials
- Awesome Options Analytics — curated resource list
MIT — see LICENSE
This repo computes the math from scratch and against the live API. Production workloads (full-universe coverage, point-in-time history, aggregate vanna/charm) run on the Alpha tier: flashalpha.com/for-quant-teams