flashalpha 1.2.3__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -211,11 +211,11 @@ cython_debug/
211
211
  marimo/_static/
212
212
  marimo/_lsp/
213
213
  __marimo__/
214
-
215
- # Sandbox / agent / harness caches (cross-ecosystem — defensive)
216
- .dotnet/
217
- .gocache/
218
- .gopath/
219
- .m2/
220
- .review-artifacts/
221
- .agent-tools/
214
+
215
+ # Sandbox / agent / harness caches (cross-ecosystem — defensive)
216
+ .dotnet/
217
+ .gocache/
218
+ .gopath/
219
+ .m2/
220
+ .review-artifacts/
221
+ .agent-tools/
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 FlashAlpha
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FlashAlpha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: flashalpha
3
- Version: 1.2.3
3
+ Version: 1.3.0
4
4
  Summary: Python SDK for the FlashAlpha options analytics API — live options screener, gamma exposure (GEX), VRP, delta, vanna, charm, greeks, 0DTE analytics, volatility surfaces, and more.
5
5
  Project-URL: Homepage, https://flashalpha.com
6
6
  Project-URL: Documentation, https://flashalpha.com/docs
@@ -55,7 +55,9 @@ fa = FlashAlpha("YOUR_API_KEY") # Get a free key at flashalpha.com
55
55
  # Gamma exposure by strike
56
56
  gex = fa.gex("SPY")
57
57
  print(f"Net GEX: ${gex['net_gex']:,.0f}")
58
- print(f"Gamma flip: {gex['gamma_flip']}")
58
+ # gamma_flip is None unless gamma_flip_status == "available" -- never format it
59
+ # as a number without checking first.
60
+ print(f"Gamma flip: {gex['gamma_flip']} ({gex['gamma_flip_status']})")
59
61
 
60
62
  for strike in gex["strikes"][:5]:
61
63
  print(f" {strike['strike']}: net ${strike['net_gex']:,.0f}")
@@ -63,6 +65,78 @@ for strike in gex["strikes"][:5]:
63
65
 
64
66
  Get your free API key at [flashalpha.com](https://flashalpha.com) — no credit card required.
65
67
 
68
+ > **`gamma_flip` is nullable.** A dealer gamma flip is only published when the
69
+ > level is well-determined, which is a minority of chains. When it is withheld,
70
+ > `gamma_flip` is `null`, `regime` is `"unknown"`, and `gamma_flip_status` carries
71
+ > a reason code (`no_boundary`, `insufficient_local_coverage`,
72
+ > `insufficient_quote_quality`, `sensitive_root`, `uncertain_root_path`,
73
+ > `stored_sign_mismatch`, `search_budget`, `quality_budget`). Only
74
+ > `gamma_flip_status == "available"` guarantees a number; treat any other value -
75
+ > including codes added in future - as "no level published".
76
+
77
+ ## Data provenance: `data_as_of`
78
+
79
+ Every successful JSON-object response carries `data_as_of`, reporting when each upstream
80
+ feed last delivered to the node that answered, plus `endpoint_version` identifying the
81
+ deployment that produced it. That is every method on this client except the handful that
82
+ return a bare JSON array - see the note at the end of this section.
83
+
84
+ ```python
85
+ gex = fa.gex("SPY")
86
+
87
+ print(gex["data_as_of"]["equity_options_feed"]) # 2026-08-25T18:48:58.204Z
88
+ print(gex["data_as_of"]["oi_feed"]) # 2026-08-24T20:00:00.000Z (prior session)
89
+ print(gex["data_as_of"]["node"]) # fa2
90
+ print(gex["endpoint_version"]) # 2026.08.25
91
+
92
+ # Typed: DataAsOf is exported for annotation and editor completion.
93
+ from flashalpha import DataAsOf
94
+ stamps: DataAsOf = gex["data_as_of"]
95
+ ```
96
+
97
+ | Field | Feed | Expected cadence |
98
+ |---|---|---|
99
+ | `node` | Which node answered | Nodes hydrate independently |
100
+ | `equity_feed` | Equity and ETF spot quotes | seconds, during market hours |
101
+ | `equity_options_feed` | Equity and ETF option quotes | seconds, during market hours |
102
+ | `index_feed` | Index spot (SPX, RUT, VIX and the other index roots) | seconds, during market hours |
103
+ | `index_options_feed` | Index option quotes | seconds, during market hours |
104
+ | `futures_feed` | Futures prices | seconds, during the futures session |
105
+ | `futures_options_feed` | Futures option quotes | seconds, during the futures session |
106
+ | `flow_feed` | Classified options and stock trade tape | seconds, during market hours |
107
+ | `oi_feed` | Settled open interest | daily, dated to the prior 16:00 ET close |
108
+ | `macro_feed` | VIX, VVIX, SKEW, MOVE, SPX, Fear & Greed | minutes; reports its OLDEST component |
109
+
110
+ ### How to read it
111
+
112
+ - **Check the feeds your call depends on.** A GEX call on an equity is answered from
113
+ `equity_feed`, `equity_options_feed` and `oi_feed`. `futures_feed` being `null` in that
114
+ response says nothing about the answer.
115
+ - **Compare against the cadence, not the clock.** `oi_feed` at the previous session's
116
+ close is correct: settled open interest is published once per session, so on a Monday
117
+ the newest figure that exists is Friday's. An options feed an hour behind during the
118
+ regular session is not correct.
119
+ - **`null` means "not seen on this node", not "broken".** A node that has never been
120
+ asked for a futures symbol has never opened that feed.
121
+ - **Spot and options are separate on purpose.** They arrive over different pipes and can
122
+ fail independently.
123
+ - **It evidences feed activity, not per-contract freshness.** An illiquid strike may not
124
+ have quoted for hours while its feed is healthy.
125
+ - **`data_as_of` is not `as_of`.** `as_of` is response-generation time or the newest
126
+ contract in the payload, depending on the endpoint. `data_as_of` describes the feeds
127
+ behind it.
128
+
129
+ ### Bare-array endpoints
130
+
131
+ A few endpoints return a bare JSON array, which has nowhere to put an envelope in the
132
+ body. The API sends the same information in the `X-Data-As-Of` and `X-Endpoint-Version`
133
+ response headers instead - but this client returns the parsed body only and does not
134
+ surface response headers, so the envelope is **not reachable through those methods**.
135
+ Call the HTTP endpoint directly if you need provenance for one of them.
136
+
137
+ Full reference: <https://flashalpha.com/docs/lab-api-overview#response-envelope> and the
138
+ methodology whitepaper at <https://flashalpha.com/methodology#freshness-reporting>.
139
+
66
140
  ## Features
67
141
 
68
142
  ### Live Options Screener
@@ -117,7 +191,8 @@ chex = fa.chex("NVDA") # Charm exposure
117
191
  levels = fa.exposure_levels("SPY") # Key levels
118
192
  print(f"Call wall: {levels['levels']['call_wall']}")
119
193
  print(f"Put wall: {levels['levels']['put_wall']}")
120
- print(f"Gamma flip: {levels['levels']['gamma_flip']}")
194
+ print(f"Gamma flip: {levels['levels']['gamma_flip']} "
195
+ f"({levels['levels']['gamma_flip_status']})")
121
196
 
122
197
  summary = fa.exposure_summary("SPY") # Full summary (Growth+)
123
198
  narrative = fa.narrative("SPY") # AI narrative (Growth+)
@@ -416,7 +491,7 @@ calculator and stock quotes. Paid tiers add:
416
491
  - **DEX, VEX (vanna) and CHEX (charm) exposure, plus max pain** — from the **Basic tier**
417
492
  ($79/mo), with ETF and index symbols.
418
493
  - **Full-chain GEX, 0DTE and flow analytics** — from the **Growth tier** ($299/mo).
419
- - **Point-in-time replay since 2018, SVI vol surfaces, VRP analytics, higher-order Greeks**,
494
+ - **Point-in-time replay since 2017, SVI vol surfaces, VRP analytics, higher-order Greeks**,
420
495
  uncached and unlimited — the **Alpha tier** ($1,499/mo). FlashAlpha is one of the only
421
496
  public APIs publishing aggregate vanna and charm exposure across the full universe, with
422
497
  no look-ahead and no training-serving skew.
@@ -23,7 +23,9 @@ fa = FlashAlpha("YOUR_API_KEY") # Get a free key at flashalpha.com
23
23
  # Gamma exposure by strike
24
24
  gex = fa.gex("SPY")
25
25
  print(f"Net GEX: ${gex['net_gex']:,.0f}")
26
- print(f"Gamma flip: {gex['gamma_flip']}")
26
+ # gamma_flip is None unless gamma_flip_status == "available" -- never format it
27
+ # as a number without checking first.
28
+ print(f"Gamma flip: {gex['gamma_flip']} ({gex['gamma_flip_status']})")
27
29
 
28
30
  for strike in gex["strikes"][:5]:
29
31
  print(f" {strike['strike']}: net ${strike['net_gex']:,.0f}")
@@ -31,6 +33,78 @@ for strike in gex["strikes"][:5]:
31
33
 
32
34
  Get your free API key at [flashalpha.com](https://flashalpha.com) — no credit card required.
33
35
 
36
+ > **`gamma_flip` is nullable.** A dealer gamma flip is only published when the
37
+ > level is well-determined, which is a minority of chains. When it is withheld,
38
+ > `gamma_flip` is `null`, `regime` is `"unknown"`, and `gamma_flip_status` carries
39
+ > a reason code (`no_boundary`, `insufficient_local_coverage`,
40
+ > `insufficient_quote_quality`, `sensitive_root`, `uncertain_root_path`,
41
+ > `stored_sign_mismatch`, `search_budget`, `quality_budget`). Only
42
+ > `gamma_flip_status == "available"` guarantees a number; treat any other value -
43
+ > including codes added in future - as "no level published".
44
+
45
+ ## Data provenance: `data_as_of`
46
+
47
+ Every successful JSON-object response carries `data_as_of`, reporting when each upstream
48
+ feed last delivered to the node that answered, plus `endpoint_version` identifying the
49
+ deployment that produced it. That is every method on this client except the handful that
50
+ return a bare JSON array - see the note at the end of this section.
51
+
52
+ ```python
53
+ gex = fa.gex("SPY")
54
+
55
+ print(gex["data_as_of"]["equity_options_feed"]) # 2026-08-25T18:48:58.204Z
56
+ print(gex["data_as_of"]["oi_feed"]) # 2026-08-24T20:00:00.000Z (prior session)
57
+ print(gex["data_as_of"]["node"]) # fa2
58
+ print(gex["endpoint_version"]) # 2026.08.25
59
+
60
+ # Typed: DataAsOf is exported for annotation and editor completion.
61
+ from flashalpha import DataAsOf
62
+ stamps: DataAsOf = gex["data_as_of"]
63
+ ```
64
+
65
+ | Field | Feed | Expected cadence |
66
+ |---|---|---|
67
+ | `node` | Which node answered | Nodes hydrate independently |
68
+ | `equity_feed` | Equity and ETF spot quotes | seconds, during market hours |
69
+ | `equity_options_feed` | Equity and ETF option quotes | seconds, during market hours |
70
+ | `index_feed` | Index spot (SPX, RUT, VIX and the other index roots) | seconds, during market hours |
71
+ | `index_options_feed` | Index option quotes | seconds, during market hours |
72
+ | `futures_feed` | Futures prices | seconds, during the futures session |
73
+ | `futures_options_feed` | Futures option quotes | seconds, during the futures session |
74
+ | `flow_feed` | Classified options and stock trade tape | seconds, during market hours |
75
+ | `oi_feed` | Settled open interest | daily, dated to the prior 16:00 ET close |
76
+ | `macro_feed` | VIX, VVIX, SKEW, MOVE, SPX, Fear & Greed | minutes; reports its OLDEST component |
77
+
78
+ ### How to read it
79
+
80
+ - **Check the feeds your call depends on.** A GEX call on an equity is answered from
81
+ `equity_feed`, `equity_options_feed` and `oi_feed`. `futures_feed` being `null` in that
82
+ response says nothing about the answer.
83
+ - **Compare against the cadence, not the clock.** `oi_feed` at the previous session's
84
+ close is correct: settled open interest is published once per session, so on a Monday
85
+ the newest figure that exists is Friday's. An options feed an hour behind during the
86
+ regular session is not correct.
87
+ - **`null` means "not seen on this node", not "broken".** A node that has never been
88
+ asked for a futures symbol has never opened that feed.
89
+ - **Spot and options are separate on purpose.** They arrive over different pipes and can
90
+ fail independently.
91
+ - **It evidences feed activity, not per-contract freshness.** An illiquid strike may not
92
+ have quoted for hours while its feed is healthy.
93
+ - **`data_as_of` is not `as_of`.** `as_of` is response-generation time or the newest
94
+ contract in the payload, depending on the endpoint. `data_as_of` describes the feeds
95
+ behind it.
96
+
97
+ ### Bare-array endpoints
98
+
99
+ A few endpoints return a bare JSON array, which has nowhere to put an envelope in the
100
+ body. The API sends the same information in the `X-Data-As-Of` and `X-Endpoint-Version`
101
+ response headers instead - but this client returns the parsed body only and does not
102
+ surface response headers, so the envelope is **not reachable through those methods**.
103
+ Call the HTTP endpoint directly if you need provenance for one of them.
104
+
105
+ Full reference: <https://flashalpha.com/docs/lab-api-overview#response-envelope> and the
106
+ methodology whitepaper at <https://flashalpha.com/methodology#freshness-reporting>.
107
+
34
108
  ## Features
35
109
 
36
110
  ### Live Options Screener
@@ -85,7 +159,8 @@ chex = fa.chex("NVDA") # Charm exposure
85
159
  levels = fa.exposure_levels("SPY") # Key levels
86
160
  print(f"Call wall: {levels['levels']['call_wall']}")
87
161
  print(f"Put wall: {levels['levels']['put_wall']}")
88
- print(f"Gamma flip: {levels['levels']['gamma_flip']}")
162
+ print(f"Gamma flip: {levels['levels']['gamma_flip']} "
163
+ f"({levels['levels']['gamma_flip_status']})")
89
164
 
90
165
  summary = fa.exposure_summary("SPY") # Full summary (Growth+)
91
166
  narrative = fa.narrative("SPY") # AI narrative (Growth+)
@@ -384,7 +459,7 @@ calculator and stock quotes. Paid tiers add:
384
459
  - **DEX, VEX (vanna) and CHEX (charm) exposure, plus max pain** — from the **Basic tier**
385
460
  ($79/mo), with ETF and index symbols.
386
461
  - **Full-chain GEX, 0DTE and flow analytics** — from the **Growth tier** ($299/mo).
387
- - **Point-in-time replay since 2018, SVI vol surfaces, VRP analytics, higher-order Greeks**,
462
+ - **Point-in-time replay since 2017, SVI vol surfaces, VRP analytics, higher-order Greeks**,
388
463
  uncached and unlimited — the **Alpha tier** ($1,499/mo). FlashAlpha is one of the only
389
464
  public APIs publishing aggregate vanna and charm exposure across the full universe, with
390
465
  no look-ahead and no training-serving skew.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "flashalpha"
7
- version = "1.2.3"
7
+ version = "1.3.0"
8
8
  description = "Python SDK for the FlashAlpha options analytics API — live options screener, gamma exposure (GEX), VRP, delta, vanna, charm, greeks, 0DTE analytics, volatility surfaces, and more."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -10,6 +10,7 @@ from .exceptions import (
10
10
  TierRestrictedError,
11
11
  )
12
12
  from .types import (
13
+ DataAsOf,
13
14
  ExposureSummaryExposures,
14
15
  ExposureSummaryHedgingEstimate,
15
16
  ExposureSummaryHedgingMove,
@@ -278,6 +279,7 @@ from .types import (
278
279
 
279
280
  __version__ = "1.2.3"
280
281
  __all__ = [
282
+ "DataAsOf",
281
283
  "FlashAlpha",
282
284
  "FlashAlphaError",
283
285
  "AuthenticationError",
@@ -1,39 +1,39 @@
1
- """FlashAlpha API exceptions."""
2
-
3
-
4
- class FlashAlphaError(Exception):
5
- """Base exception for FlashAlpha SDK."""
6
-
7
- def __init__(self, message: str, status_code: int | None = None, response: dict | None = None):
8
- super().__init__(message)
9
- self.status_code = status_code
10
- self.response = response
11
-
12
-
13
- class AuthenticationError(FlashAlphaError):
14
- """Raised when the API key is invalid or missing (401)."""
15
-
16
-
17
- class TierRestrictedError(FlashAlphaError):
18
- """Raised when the endpoint requires a higher plan (403)."""
19
-
20
- def __init__(self, message: str, current_plan: str | None = None, required_plan: str | None = None, **kwargs):
21
- super().__init__(message, **kwargs)
22
- self.current_plan = current_plan
23
- self.required_plan = required_plan
24
-
25
-
26
- class NotFoundError(FlashAlphaError):
27
- """Raised when the requested resource is not found (404)."""
28
-
29
-
30
- class RateLimitError(FlashAlphaError):
31
- """Raised when the rate limit is exceeded (429)."""
32
-
33
- def __init__(self, message: str, retry_after: int | None = None, **kwargs):
34
- super().__init__(message, **kwargs)
35
- self.retry_after = retry_after
36
-
37
-
38
- class ServerError(FlashAlphaError):
39
- """Raised on 5xx server errors."""
1
+ """FlashAlpha API exceptions."""
2
+
3
+
4
+ class FlashAlphaError(Exception):
5
+ """Base exception for FlashAlpha SDK."""
6
+
7
+ def __init__(self, message: str, status_code: int | None = None, response: dict | None = None):
8
+ super().__init__(message)
9
+ self.status_code = status_code
10
+ self.response = response
11
+
12
+
13
+ class AuthenticationError(FlashAlphaError):
14
+ """Raised when the API key is invalid or missing (401)."""
15
+
16
+
17
+ class TierRestrictedError(FlashAlphaError):
18
+ """Raised when the endpoint requires a higher plan (403)."""
19
+
20
+ def __init__(self, message: str, current_plan: str | None = None, required_plan: str | None = None, **kwargs):
21
+ super().__init__(message, **kwargs)
22
+ self.current_plan = current_plan
23
+ self.required_plan = required_plan
24
+
25
+
26
+ class NotFoundError(FlashAlphaError):
27
+ """Raised when the requested resource is not found (404)."""
28
+
29
+
30
+ class RateLimitError(FlashAlphaError):
31
+ """Raised when the rate limit is exceeded (429)."""
32
+
33
+ def __init__(self, message: str, retry_after: int | None = None, **kwargs):
34
+ super().__init__(message, **kwargs)
35
+ self.retry_after = retry_after
36
+
37
+
38
+ class ServerError(FlashAlphaError):
39
+ """Raised on 5xx server errors."""