|
| 1 | +# FlashAlpha — Python SDK |
| 2 | + |
| 3 | +> FlashAlpha is an institutional-grade options analytics API: dealer |
| 4 | +> positioning (GEX/DEX/VEX/CHEX), gamma flip, call/put walls, max pain, |
| 5 | +> 0DTE attribution, variance risk premium, IV term structure, and |
| 6 | +> macro context — all on one round-trip per endpoint. |
| 7 | + |
| 8 | +This is the live (current-minute) Python SDK. For point-in-time replay |
| 9 | +of every analytics endpoint going back to 2018, see the companion |
| 10 | +`flashalpha-historical` package. |
| 11 | + |
| 12 | +## Install |
| 13 | + |
| 14 | +```bash |
| 15 | +pip install flashalpha |
| 16 | +``` |
| 17 | + |
| 18 | +## Quickstart |
| 19 | + |
| 20 | +```python |
| 21 | +from flashalpha import FlashAlpha |
| 22 | + |
| 23 | +client = FlashAlpha(api_key="YOUR_API_KEY") |
| 24 | + |
| 25 | +# Single-call dashboard — price, IV, HV, VRP, skew, term structure, |
| 26 | +# full dealer exposure, macro context. |
| 27 | +summary = client.stock_summary("SPY") |
| 28 | + |
| 29 | +# Net dealer Greeks + gamma flip + ±1% hedging estimate. |
| 30 | +exp = client.exposure_summary("SPY") |
| 31 | + |
| 32 | +# Same-day-expiry deep dive (±10bp / ±25bp / ±50bp / ±1% buckets, |
| 33 | +# pin risk, time-to-close decay). |
| 34 | +zdte = client.zero_dte("SPY") |
| 35 | + |
| 36 | +# Variance Risk Premium dashboard (Alpha+). |
| 37 | +vrp = client.vrp("SPY") |
| 38 | + |
| 39 | +# Max pain dashboard (Basic+). |
| 40 | +mp = client.maxpain("SPY") |
| 41 | + |
| 42 | +# Dealer-flow levels — gamma flip, walls, 0DTE magnet. |
| 43 | +levels = client.exposure_levels("SPY") |
| 44 | + |
| 45 | +# LLM-friendly verbal output (Growth+). |
| 46 | +narrative = client.exposure_narrative("SPY") |
| 47 | +``` |
| 48 | + |
| 49 | +## Key endpoints |
| 50 | + |
| 51 | +- `GET /v1/stock/{symbol}/summary` — single best snapshot. Price, IV, |
| 52 | + HV, VRP, 25-delta skew, IV term structure, options flow aggregates, |
| 53 | + full dealer exposure (Greeks, walls, gamma flip, max pain, hedging |
| 54 | + estimate, 0DTE attribution, top strikes), and macro context (VIX, |
| 55 | + VVIX, SKEW, SPX, MOVE, term structure, fear/greed). Dual-mode auth: |
| 56 | + authenticated = live; unauthenticated = previous-day cached snapshot. |
| 57 | +- `GET /v1/exposure/summary/{symbol}` — net dealer Greeks |
| 58 | + (gamma/delta/vanna/charm), gamma flip, ±1% hedging estimate, |
| 59 | + verbal regime narratives, 0DTE attribution. |
| 60 | +- `GET /v1/exposure/zero-dte/{symbol}` — same-day-expiry deep dive: |
| 61 | + ±10bp / ±25bp / ±50bp / ±1% hedging buckets, pin-risk scoring, |
| 62 | + time-to-close decay, vol context, full strike grid. |
| 63 | +- `GET /v1/exposure/levels/{symbol}` — pared-down headline strikes: |
| 64 | + gamma flip, max ±gamma, call wall, put wall, highest OI, 0DTE magnet. |
| 65 | +- `GET /v1/exposure/narrative/{symbol}` — LLM-friendly verbal output: |
| 66 | + plain-English narrative strings safe to surface verbatim, paired |
| 67 | + with the numeric data block that backs them. (Growth+) |
| 68 | +- `GET /v1/vrp/{symbol}` — Variance Risk Premium dashboard: core IV |
| 69 | + vs RV ladders, directional skew (downside vs upside), term VRP, |
| 70 | + GEX-conditioned harvest score, vanna-conditioned outlook, regime |
| 71 | + classification, strategy suitability scores. (Alpha+) |
| 72 | +- `GET /v1/maxpain/{symbol}` — strike where total option-holder pain |
| 73 | + is minimized; per-strike pain curve, OI breakdown, per-expiry |
| 74 | + calendar, GEX-based dealer alignment, expected move, pin |
| 75 | + probability. (Basic+) |
| 76 | +- `GET /v1/pricing/greeks` — stateless Black-Scholes-Merton pricer: |
| 77 | + theoretical price plus first/second/third-order Greeks |
| 78 | + (delta, gamma, theta, vega, rho, vanna, charm, vomma, dual delta, |
| 79 | + speed, zomma, color, ultima, lambda, veta). |
| 80 | + |
| 81 | +## Typed responses |
| 82 | + |
| 83 | +Every endpoint listed above has a corresponding `TypedDict` model in |
| 84 | +`flashalpha.types`. At runtime each response is a plain `dict`, so |
| 85 | +existing `result["field"]` code keeps working — type checkers and IDEs |
| 86 | +just see the field shape and provide autocomplete. |
| 87 | + |
| 88 | +```python |
| 89 | +from flashalpha import StockSummaryResponse, ExposureSummaryResponse |
| 90 | + |
| 91 | +summary: StockSummaryResponse = client.stock_summary("SPY") |
| 92 | +gamma_flip = summary["exposure"]["gamma_flip"] # autocompleted |
| 93 | +``` |
| 94 | + |
| 95 | +## Tier breakdown |
| 96 | + |
| 97 | +- **Free**: dual-mode preview tier — `stock_summary` returns a |
| 98 | + previous-day cached snapshot without an API key. |
| 99 | +- **Basic**: live `exposure_summary`, `exposure_levels`, `zero_dte`, |
| 100 | + `maxpain`, `pricing/greeks`. |
| 101 | +- **Alpha**: adds `vrp` and full historical replay of the above. |
| 102 | +- **Growth**: adds `exposure_narrative` and higher rate limits. |
| 103 | +- **Pro / Enterprise**: bespoke; contact sales. |
| 104 | + |
| 105 | +## Links |
| 106 | + |
| 107 | +- Playground (interactive Swagger): https://lab.flashalpha.com/swagger |
| 108 | +- Sign up: https://flashalpha.com |
| 109 | +- GitHub: https://github.com/flashalpha |
0 commit comments