- Live API Reference
- Strategy Signals
- Expiry Positioning
Expiry Positioning Strategy API
Scores OPEX pin risk for a single expiry from max-pain, OI concentration, and dealer levels (gamma flip, call/put walls), and proposes an iron fly when a pin is likely.
Endpoint
X-Api-Key)
Rate Limited: Yes
Plan: Basic+
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
symbol |
path | string | required | - | Underlying symbol |
expiry |
query | date | nearest upcoming expiry | yyyy-MM-dd. The expiry to analyse. Invalid values return 400 expiry_in_past or 400 invalid_expiry. |
|
minOpenInterest |
query | integer | 250 |
Minimum OI a leg must have to be selected. Non-numeric values return a 400 problem-details body. | |
wingWidth |
query | number | 5.0 |
Iron-fly wing width, in strike points. Non-numeric values return a 400 problem-details body. |
Request
curl -H "X-Api-Key: YOUR_API_KEY" \
"https://lab.flashalpha.com/v1/strategies/expiry-positioning/SPY?expiry=2027-12-17&wingWidth=5"import requests
resp = requests.get(
"https://lab.flashalpha.com/v1/strategies/expiry-positioning/SPY",
params={"expiry": "2027-12-17", "wingWidth": 5},
headers={"X-Api-Key": "YOUR_API_KEY"}
)
resp.raise_for_status()
data = resp.json()
print(f"{data['decision']} (score {data['score']}, regime {data['regime']})")const resp = await fetch(
"https://lab.flashalpha.com/v1/strategies/expiry-positioning/SPY?expiry=2027-12-17&wingWidth=5",
{ headers: { "X-Api-Key": "YOUR_API_KEY" } }
);
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
const data = await resp.json();
console.log(`${data.decision} (score ${data.score}, regime ${data.regime})`);Try it live
Runs on live market data and uses 1 request from your daily quota.
Response
Returns the standard strategy decision envelope. The metrics and regime fields are specific to this strategy (see below).
{
"strategy": "expiry_positioning",
"symbol": "SPY",
"timestamp": "2026-10-30T13:46:23.0527184Z",
"decision": "neutral",
"score": 0,
"confidence": 1,
"regime": "no_pin_setup",
"best_structures": [],
"metrics": {
"max_pain_strike": 1050,
"distance_to_pain_pct": 0.3809,
"oi_concentration_score": 0.042,
"total_open_interest": 706504,
"expiry": "2027-12-17",
"days_to_expiry": 413,
"underlying_price": 760.36,
"gamma_flip": null,
"gamma_flip_status": "stored_sign_mismatch",
"call_wall": 900,
"put_wall": 720,
"distance_to_flip_pct": null,
"spot_position_label": "inside_walls"
},
"risk_flags": [],
"why": [
"Pin score 0 is below the 60 threshold required to express a pin trade."
],
"avoid_if": [],
"data_quality": {
"score": 90,
"warnings": []
},
"endpoint_version": "2026.09.30",
"data_as_of": {
"node": "fa4",
"equity_feed": "2026-10-30T13:46:22.793Z",
"equity_options_feed": "2026-10-30T13:46:22Z",
"index_feed": "2026-10-30T13:46:22.109Z",
"index_options_feed": "2026-10-30T13:46:19Z",
"futures_feed": "2026-10-30T13:46:19.311Z",
"futures_options_feed": "2026-10-30T13:46:19.486Z",
"flow_feed": "2026-10-30T13:46:00Z",
"oi_feed": "2026-10-29T20:00:00Z",
"macro_feed": "2026-10-29T21:00:20Z"
}
}Sending request…
See this endpoint on live data
Send this exact request and the real response shows up here, right next to the example.
Response Fields
Fields of the metrics object. The rest of the response is the shared decision envelope.
| Field | Type | Description |
|---|---|---|
max_pain_strike | number | Max pain strike of the expiry |
distance_to_pain_pct | number | Distance from spot to max_pain_strike (decimal) |
oi_concentration_score | number | Concentration of open interest across strikes (higher = more concentrated) |
total_open_interest | number | Total open interest of the expiry |
expiry | string | Expiry the metrics are read from (yyyy-MM-dd) |
days_to_expiry | number | Calendar days from today to expiry |
underlying_price | number | Underlying price used for the read |
gamma_flip | number | Strike where net GEX crosses zero |
gamma_flip_status | string | available when gamma_flip is a certified level; any other value means unverified or missing |
call_wall | number | Strike with the largest call gamma |
put_wall | number | Strike with the largest put gamma |
distance_to_flip_pct | number | Distance from spot to gamma_flip (decimal, 0.017 = 1.7%) |
spot_position_label | string | Where spot sits against the walls, e.g. inside_walls |
Regime Values
strong_pin_likelymoderate_pinno_pin_setup
Errors
| Status | Error | When |
|---|---|---|
400 | invalid_expiry | expiry is present but not yyyy-MM-dd. |
400 | expiry_in_past | expiry is a date before today (ET). |
400 | - | A query value has the wrong type, or a required value is missing. The body is an RFC 7807 problem-details object with errors.<param>. |
401 | - | Missing or invalid X-Api-Key. The body is empty; check the status code before parsing JSON. |
403 | tier_restricted | Your plan is below Basic. The body includes current_plan and required_plan. |
404 | symbol_not_found | No market data for the symbol. |
429 | Quota exceeded | Daily quota used up. Retry-After gives the seconds until the reset at 00:00 UTC. Rejected requests (including 403) count toward the quota. |
About
Expiry positioning measures how likely spot is to pin to a strike into an expiry. It combines the max-pain strike and the distance to it, open-interest concentration, and dealer levels (gamma flip, call wall, put wall) into a single pin-risk score and regime.
When a pin looks strong, the strategy proposes an iron fly centred on the pin so the read arrives as a ranked, tradeable structure. Use minOpenInterest and wingWidth to tune leg selection and the wing.
Common Use Cases
- Flag likely pins - read
regimeto find OPEX names where positioning makes a pin into the close likely - Trade only clean signals - act when
decisioniscandidateand skipno_setupreads where positioning is diffuse - Drop in the proposed structure - pull
best_structures[]for an iron-fly centred on the max-pain strike - Rank the watchlist - sort by
scoreto compare distance-to-pain and OI concentration across a universe - Size on conviction - scale the clip by
scoreandconfidencerather than a fixed lot - Respect the guardrails - honor
risk_flags[]and require a cleandata_qualitybefore fading toward the pin
Related
Related reading
- Max-pain trading strategies & pin-risk expiration setups - the pin mechanics behind the signal
- ML on options data: a quant guide - feed positioning features into a systematic model
- Alpha decay: which signals erode - how a pin edge behaves into expiry
Complementary endpoints
- Strategy Signals overview - the shared decision envelope across every strategy
- Max Pain - the raw pin strike and OI concentration the signal is built on
- 0DTE - carry the pin read into the same-day session
Unlock DEX, VEX and CHEX with Basic
Everything in Free, plus:
- DEX, VEX and CHEX exposure
- Full max pain
- ETF & index symbols SPY, QQQ, SPX, VIX
Go full-chain with Growth
Everything in Basic, plus:
- Full-chain GEX Every expiration
- 0DTE analytics
- Exposure summary & AI narrative
- CME futures & live screener
Add history and vol surfaces with Alpha
Everything in Growth, plus:
- Historical API replay Since 2017
- SVI vol surfaces
- VRP analytics
- Greeks surfaces Vanna, charm, volga and speed grids