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
Basic+
Parameters
| Name | In | Required | Default | Description |
|---|---|---|---|---|
symbol |
path | yes | - | Underlying symbol |
expiry |
query | no | nearest upcoming expiry | yyyy-MM-dd. The expiry to analyse. |
minOpenInterest |
query | no | 250 |
Minimum OI a leg must have to be selected. |
wingWidth |
query | no | 5.0 |
Iron-fly wing width, in strike points. |
curl -H "X-Api-Key: YOUR_API_KEY" \
"https://lab.flashalpha.com/v1/strategies/expiry-positioning/SPY?expiry=2026-06-19&wingWidth=5"
import requests
resp = requests.get(
"https://lab.flashalpha.com/v1/strategies/expiry-positioning/SPY",
params={"expiry": "2026-06-19", "wingWidth": 5},
headers={"X-Api-Key": "YOUR_API_KEY"}
)
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=2026-06-19&wingWidth=5",
{ headers: { "X-Api-Key": "YOUR_API_KEY" } }
);
const data = await resp.json();
console.log(`${data.decision} (score ${data.score}, regime ${data.regime})`);
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-06-05T14:32:11Z",
"decision": "candidate",
"score": 72,
"confidence": 0.83,
"regime": "strong_pin_likely",
"best_structures": [
{
"rank": 1,
"structure": "iron_fly",
"expiry": "2026-06-19",
"legs": [
{ "action": "sell", "type": "put", "strike": 588, "delta": -0.25, "premium": 1.42, "quantity": 1 },
{ "action": "buy", "type": "put", "strike": 578, "delta": -0.12, "premium": 0.72, "quantity": 1 }
],
"credit": 0.70,
"debit": null,
"max_profit": 0.70,
"max_loss": 9.30,
"breakevens": [587.30],
"edge_score": 72,
"liquidity_score": 0.88
}
],
"metrics": {
"max_pain_strike": 590,
"underlying_price": 589.12
},
"risk_flags": [],
"why": ["Spot is pinned near max pain with concentrated open interest."],
"avoid_if": ["A directional catalyst pulls spot away from the pin strike."],
"data_quality": { "score": 90, "warnings": [] }
}
Notable Metrics
| Key |
|---|
max_pain_strike |
distance_to_pain_pct |
oi_concentration_score |
total_open_interest |
expiry |
days_to_expiry |
gamma_flip |
call_wall |
put_wall |
distance_to_flip_pct |
spot_position_label |
underlying_price |
Regime Values
strong_pin_likelymoderate_pinno_pin_setup
Errors
| Status | error |
When |
|---|---|---|
400 | invalid_expiry | expiry is present but not yyyy-MM-dd. |
403 | tier_restricted | Caller is below the Basic plan. |
404 | symbol_not_found | No market data for the symbol. |
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
- Zero-DTE - carry the pin read into the same-day session
Ready to build?
Get your free API key and start pulling live options data in 30 seconds.