Skip to content

Commit 6585e34

Browse files
tdobrowolski1claude
andcommitted
Add live Flow API tier (22 endpoints) + audit fixes
- Typed models + client methods + LLM-discoverable docs for all /v1/flow/* analytics + raw-flow endpoints; reuse existing Gex/Dex strike types - Remove non-existent /v1/exposure/history endpoint - Fix slices_used type (int count, was string[]) - Per-endpoint live integration tests; tolerate legit-null Optional fields Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4a62aaa commit 6585e34

7 files changed

Lines changed: 1404 additions & 98 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ Get your API key at **[flashalpha.com](https://flashalpha.com)**
231231
| `fa.exposure_summary(symbol)` | Full exposure summary with hedging | Growth+ |
232232
| `fa.narrative(symbol)` | AI narrative analysis | Growth+ |
233233
| `fa.zero_dte(symbol)` | 0DTE analytics (regime, pin risk, decay) | Growth+ |
234-
| `fa.exposure_history(symbol)` | Daily exposure snapshots | Growth+ |
235234
| `fa.stock_quote(ticker)` | Live stock quote | Free+ |
236235
| `fa.option_quote(ticker)` | Option quotes with greeks | Growth+ |
237236
| `fa.stock_summary(symbol)` | Comprehensive stock summary | Public/Free+ |

docs/api.md

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ https://lab.flashalpha.com/v1/symbols?apiKey=YOUR_API_KEY
6666
- [`GET /v1/exposure/narrative/{symbol}`](#get-v1exposurenarrativesymbol) — Verbal narrative analysis `Growth+`
6767
- [`GET /v1/exposure/zero-dte/{symbol}`](#get-v1exposurezero-dtesymbol) — Real-time 0DTE analytics `Growth+`
6868
- [`GET /v1/maxpain/{symbol}`](#get-v1maxpainsymbol) — Max pain analysis with dealer alignment `Basic+`
69-
- [`GET /v1/exposure/history/{symbol}`](#get-v1exposurehistorysymbol) — Daily exposure history `Growth+` *(coming soon)*
7069

7170
### Pricing & Sizing
7271

@@ -998,54 +997,6 @@ If the symbol has no 0DTE expiry today (e.g. SPY on Tuesday/Thursday):
998997
- `strike_range` only filters the `strikes` array — all aggregate calculations use the full 0DTE chain
999998
- All calculations are pure static (no external calls beyond the initial data fetch)
1000999

1001-
---
1002-
1003-
## `GET /v1/exposure/history/{symbol}`
1004-
1005-
Returns daily exposure snapshots for trend analysis. Data is stored end-of-day and returned newest first.
1006-
1007-
**Requires Growth plan or higher.** *Currently returns `503 coming_soon`.*
1008-
1009-
### Parameters
1010-
1011-
| Name | In | Required | Default | Description |
1012-
|------|----|----------|---------|-------------|
1013-
| `symbol` | path | yes || Underlying symbol |
1014-
| `days` | query | no | `30` | Days of history (1-365) |
1015-
1016-
### Example
1017-
1018-
```bash
1019-
curl -H "X-Api-Key: YOUR_API_KEY" \
1020-
"https://lab.flashalpha.com/v1/exposure/history/SPY?days=7"
1021-
```
1022-
1023-
### Response `200` *(when available)*
1024-
1025-
```json
1026-
{
1027-
"symbol": "SPY",
1028-
"days": 7,
1029-
"count": 5,
1030-
"snapshots": [
1031-
{
1032-
"date": "2026-02-28",
1033-
"underlying_price": 597.505,
1034-
"net_gex": 2850000000,
1035-
"net_dex": -450000000,
1036-
"net_vex": 1200000000,
1037-
"net_chex": 850000000,
1038-
"gamma_flip": 595.25,
1039-
"call_wall": 600.0,
1040-
"put_wall": 595.0,
1041-
"regime": "positive_gamma"
1042-
}
1043-
]
1044-
}
1045-
```
1046-
1047-
---
1048-
10491000
## `GET /v1/maxpain/{symbol}`
10501001

10511002
Returns max pain analysis for a symbol — the strike where total option holder payout is minimized. Includes pain curve, OI breakdown, dealer alignment overlay (gamma flip, call/put walls), expected move context, pin probability, and multi-expiry calendar.

src/flashalpha/__init__.py

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,40 @@
1616
ExposureSummaryInterpretation,
1717
ExposureSummaryResponse,
1818
ExposureSummaryZeroDte,
19+
FlowAdjustedDealerRisk,
20+
FlowCumulativePoint,
21+
FlowDealerRiskResponse,
22+
FlowDexResponse,
23+
FlowGexResponse,
24+
FlowLevelsResponse,
25+
FlowLiveResponse,
26+
FlowOiResponse,
27+
FlowOptionBlock,
28+
FlowOptionBlocksResponse,
29+
FlowOptionCumulativeResponse,
30+
FlowOptionHistoryBucket,
31+
FlowOptionHistoryResponse,
32+
FlowOptionLeaderRow,
33+
FlowOptionLeaderboardResponse,
34+
FlowOptionOutliersResponse,
35+
FlowOptionRecentResponse,
36+
FlowOptionSummaryResponse,
37+
FlowOptionTrade,
38+
FlowOutlierRow,
39+
FlowPinRiskBreakdown,
40+
FlowPinRiskResponse,
41+
FlowStockBlock,
42+
FlowStockBlocksResponse,
43+
FlowStockCumulativeResponse,
44+
FlowStockHistoryBucket,
45+
FlowStockHistoryResponse,
46+
FlowStockLeaderRow,
47+
FlowStockLeaderboardResponse,
48+
FlowStockOutliersResponse,
49+
FlowStockRecentResponse,
50+
FlowStockSummaryResponse,
51+
FlowStockTrade,
52+
FlowSummaryResponse,
1953
VrpCore,
2054
VrpDirectional,
2155
VrpGexConditioned,
@@ -278,4 +312,39 @@
278312
# ── Screener ──
279313
"ScreenerResponse",
280314
"ScreenerMeta",
315+
# ── Flow (live, simulation-aware) ──
316+
"FlowLevelsResponse",
317+
"FlowPinRiskResponse",
318+
"FlowPinRiskBreakdown",
319+
"FlowSummaryResponse",
320+
"FlowOiResponse",
321+
"FlowGexResponse",
322+
"FlowDexResponse",
323+
"FlowDealerRiskResponse",
324+
"FlowAdjustedDealerRisk",
325+
"FlowLiveResponse",
326+
"FlowOptionTrade",
327+
"FlowOptionRecentResponse",
328+
"FlowOptionSummaryResponse",
329+
"FlowOptionBlock",
330+
"FlowOptionBlocksResponse",
331+
"FlowOptionHistoryBucket",
332+
"FlowOptionHistoryResponse",
333+
"FlowCumulativePoint",
334+
"FlowOptionCumulativeResponse",
335+
"FlowStockTrade",
336+
"FlowStockRecentResponse",
337+
"FlowStockSummaryResponse",
338+
"FlowStockBlock",
339+
"FlowStockBlocksResponse",
340+
"FlowStockHistoryBucket",
341+
"FlowStockHistoryResponse",
342+
"FlowStockCumulativeResponse",
343+
"FlowOptionLeaderRow",
344+
"FlowOptionLeaderboardResponse",
345+
"FlowOutlierRow",
346+
"FlowOptionOutliersResponse",
347+
"FlowStockLeaderRow",
348+
"FlowStockLeaderboardResponse",
349+
"FlowStockOutliersResponse",
281350
]

0 commit comments

Comments
 (0)