{"id":50980623,"url":"https://github.com/FlashAlpha-lab/flashalpha-examples","last_synced_at":"2026-07-07T11:00:33.474Z","repository":{"id":344415194,"uuid":"1181428898","full_name":"FlashAlpha-lab/flashalpha-examples","owner":"FlashAlpha-lab","description":"Python examples and tutorials for the FlashAlpha options analytics API — GEX dashboards, IV scanners, vol surface plots, dealer positioning, Kelly sizing","archived":false,"fork":false,"pushed_at":"2026-05-29T08:13:01.000Z","size":517,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T20:25:25.441Z","etag":null,"topics":["0dte","examples","gamma-exposure","greeks","jupyter","options","options-analytics","python","trading","volatility"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FlashAlpha-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-14T05:54:38.000Z","updated_at":"2026-06-01T17:37:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/FlashAlpha-lab/flashalpha-examples","commit_stats":null,"previous_names":["flashalpha-lab/flashalpha-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FlashAlpha-lab/flashalpha-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashAlpha-lab%2Fflashalpha-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashAlpha-lab%2Fflashalpha-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashAlpha-lab%2Fflashalpha-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashAlpha-lab%2Fflashalpha-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FlashAlpha-lab","download_url":"https://codeload.github.com/FlashAlpha-lab/flashalpha-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashAlpha-lab%2Fflashalpha-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35225029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-07T02:00:07.222Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["0dte","examples","gamma-exposure","greeks","jupyter","options","options-analytics","python","trading","volatility"],"created_at":"2026-06-19T14:00:21.570Z","updated_at":"2026-07-07T11:00:33.478Z","avatar_url":"https://github.com/FlashAlpha-lab.png","language":"Python","funding_links":[],"categories":["Gamma Exposure (GEX)"],"sub_categories":["Tools"],"readme":"# FlashAlpha Cookbook\n\n[![PR](https://github.com/FlashAlpha-lab/flashalpha-examples/actions/workflows/pr.yml/badge.svg)](https://github.com/FlashAlpha-lab/flashalpha-examples/actions/workflows/pr.yml)\n\nProduction Python recipes for gamma exposure, dealer positioning, SVI vol\nsurfaces, VRP, 0DTE, and unusual flow — powered by the\n[FlashAlpha API](https://flashalpha.com).\n\nEvery recipe is a **jupytext-paired** `(.py + .ipynb)` file with executed\noutputs committed. Open any recipe in Colab via its badge, or `pip install\nflashalpha` and run the `.py` directly.\n\n```bash\npip install flashalpha matplotlib numpy\nexport FLASHALPHA_API_KEY=\"your_key_here\"\npython notebooks/tier-a-hooks/01-gex-dashboard.py\n```\n\n## Catalog\n\nSee [COOKBOOK.md](COOKBOOK.md) for the full catalog (added in Phase 1+).\n\nPhase 0 ships the foundation and one canonical recipe:\n[01-gex-dashboard](notebooks/tier-a-hooks/01-gex-dashboard.ipynb).\n\n## Authoring a new recipe\n\n```bash\npython -m scripts.new_recipe \\\n  --slug 02-gamma-flip-cross-index \\\n  --title \"Find Today's Gamma Flip Across Indexes\" \\\n  --tier free \\\n  --tier-dir tier-a-hooks\n```\n\nThis creates a paired `(.py, .ipynb)` skeleton with frontmatter, CTA cells,\nand a starter code block. Fill in the body, run it once against live API\nto record the cassette:\n\n```bash\npython -m scripts.record_cassettes notebooks/tier-a-hooks/02-gamma-flip-cross-index.ipynb\n```\n\nThen `pytest` will replay it from cassette on every PR.\n\nSee [docs/superpowers/specs/2026-05-25-flashalpha-cookbook-design.md](docs/superpowers/specs/2026-05-25-flashalpha-cookbook-design.md) for the full spec.\n\n## Test layers\n\n| Layer | What it checks | When it runs |\n|---|---|---|\n| **0** Secrets | gitleaks + auth-header scrub + regex sweep over code \u0026 outputs | pre-commit + PR |\n| **1** Structural | frontmatter schema, CTA UTMs, slug ↔ file, AST scan, link 200s | PR |\n| **2** Execution | papermill + vcrpy cassette replay; runtime + call budgets | PR |\n| **3** Golden | DataFrame \u0026 chart snapshots for backtest recipes | nightly (Phase 6+) |\n| **4** Tier static | endpoints_used ⊆ tier (`endpoint_tiers.yaml`) | PR |\n| **5** Funnel sanity | UTM rendering, link 200s, weekly stats | weekly (Phase 8) |\n\n## Repository structure\n\n- `notebooks/tier-{a,b,c,d,e,f,g}-*/` — recipes by tier\n- `cookbook_tools/` — shared Python helpers (Pydantic schema, tier-map, CTA renderer)\n- `scripts/` — CLI tools (`new_recipe.py`, `scrub_outputs.py`, `record_cassettes.py`, `sync_tier_map.py`)\n- `tests/` — Layer 0/1/2/4 test suites + cassettes\n- `endpoint_tiers.yaml` — mirror of API tier middleware (`scripts/sync_tier_map.py` to regenerate)\n- `docs/superpowers/{specs,plans}/` — design + implementation docs\n\n## What the API covers\n\nRecipes can call the full FlashAlpha endpoint surface. Beyond the core exposure\nanalytics (`/v1/exposure/gex|dex|vex|chex|summary|levels|narrative`, max pain,\nSVI surfaces, VRP, 0DTE exposure, and the live/recent/blocks flow feeds), recent\nendpoint families include:\n\n- **Strategy Signals** (`/v1/strategies/*`) — 10 systematic signals\n  (flow-anomaly, expiry-positioning, zero-dte, dealer-regime, vol-carry,\n  yield-enhancement, surface-anomaly, skew, term-structure, tail-pricing) behind\n  one uniform decision envelope, for trade selection and signal backtesting.\n- **Earnings analytics** (`/v1/earnings/*`) — calendar, expected-move, history,\n  iv-crush, earnings VRP, dealer-positioning, strategies, and a screener.\n- **Structures** (`POST /v1/structures/pnl`, `POST /v1/structures/greeks`) —\n  payoff curves and aggregate Greeks for arbitrary multi-leg structures.\n- **Zero-DTE Flow** (`/v1/flow/zero-dte/snapshot|series|hedge-flow|heatmap|strike-flow`)\n  — intraday dealer-hedging and signed-flow analytics.\n- **Extended exposure** (`/v1/exposure/sheet|term-structure|basket|oi-diff`) —\n  per-strike sheets, exposure across expiries, basket/portfolio exposure, and\n  open-interest deltas.\n- **Volatility extras** — `/v1/surface/svi`, `/v1/volatility/skew-term`,\n  `/v1/volatility/spot-vol-correlation`,\n  `/v1/volatility/realized` (Alpha+, range-based realized vol estimators:\n  close-to-close, Parkinson, Garman-Klass, Rogers-Satchell, Yang-Zhang over\n  rv10/rv20/rv30 windows),\n  `/v1/volatility/forecast` (Alpha+, conditional vol forecasts via EWMA,\n  HAR-RV, and GARCH(1,1) MLE), `/v1/dispersion`, `/v1/expected-move`,\n  `/v1/liquidity`.\n- **Macro / universe** — `/v1/macro/vix-state`, `/v1/universe`,\n  `/v1/screener/fields`, plus `/v1/flow/options/{symbol}/dealer-premium`,\n  `/v1/flow/stocks/{symbol}/bars`, and `/v1/vrp/{symbol}/history`.\n\nTier requirements for every endpoint live in [endpoint_tiers.yaml](endpoint_tiers.yaml);\nfull request/response shapes are documented at the\n[FlashAlpha API reference](https://lab.flashalpha.com/llms.txt).\n\n## Futures (CME equity-index)\n\nRecipes can target **CME equity-index futures** — **`ES=F`** (E-mini S\u0026P 500) and **`NQ=F`** (E-mini Nasdaq-100) — through the same endpoints as equities. Options-on-futures are priced with **Black-76** (forward-priced) using the correct CME contract multipliers. Everything that works for an equity works for futures: gamma exposure (GEX), DEX, VEX, CHEX, key levels, max pain, the IV surface, exposure summary, narrative, and live flow.\n\n```bash\n# Gamma exposure for the E-mini S\u0026P 500 future (note the %3D-encoded '=')\ncurl -H \"X-Api-Key: $FLASHALPHA_API_KEY\" \\\n  \"https://lab.flashalpha.com/v1/exposure/gex/ES%3DF\"\n```\n\nUse the `=F` suffix — bare `ES`/`NQ` are equities, not futures. In raw REST paths URL-encode the `=` as `%3D` (e.g. `GET /v1/exposure/gex/ES%3DF`); the `flashalpha` SDK methods take the plain string `\"ES=F\"`. Historical replay for futures is coming; live analytics are available now.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n\n## What the paid tiers unlock\n\nThe free tier covers single-expiry GEX on equities, key levels, the BSM Greeks/IV\ncalculator and stock quotes. Paid tiers add:\n\n- **DEX, VEX (vanna) and CHEX (charm) exposure, plus max pain** — from the **Basic\n  tier** ($79/mo), with ETF and index symbols.\n- **Full-chain GEX, 0DTE and flow analytics** — from the **Growth tier** ($299/mo).\n- **Point-in-time replay since 2018, SVI vol surfaces, VRP analytics, higher-order\n  Greeks**, uncached and unlimited — the **Alpha tier** ($1,499/mo). FlashAlpha is one\n  of the only public APIs publishing aggregate vanna and charm exposure across the\n  full universe, with no look-ahead and no training-serving skew.\n\nBuilt for quants, prop desks, and vol funds. See the full picture and get a key:\n**[flashalpha.com/for-quant-teams](https://flashalpha.com/for-quant-teams?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=repo-flashalpha-examples)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFlashAlpha-lab%2Fflashalpha-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFlashAlpha-lab%2Fflashalpha-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFlashAlpha-lab%2Fflashalpha-examples/lists"}