Expiry Positioning Strategy API - OPEX Pin Risk Score | FlashAlpha
  1. 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

GET /v1/strategies/expiry-positioning/{symbol}
Auth required (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.

GET

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_strikenumberMax pain strike of the expiry
distance_to_pain_pctnumberDistance from spot to max_pain_strike (decimal)
oi_concentration_scorenumberConcentration of open interest across strikes (higher = more concentrated)
total_open_interestnumberTotal open interest of the expiry
expirystringExpiry the metrics are read from (yyyy-MM-dd)
days_to_expirynumberCalendar days from today to expiry
underlying_pricenumberUnderlying price used for the read
gamma_flipnumberStrike where net GEX crosses zero
gamma_flip_statusstringavailable when gamma_flip is a certified level; any other value means unverified or missing
call_wallnumberStrike with the largest call gamma
put_wallnumberStrike with the largest put gamma
distance_to_flip_pctnumberDistance from spot to gamma_flip (decimal, 0.017 = 1.7%)
spot_position_labelstringWhere spot sits against the walls, e.g. inside_walls

Regime Values

  • strong_pin_likely
  • moderate_pin
  • no_pin_setup

Errors

Status Error When
400invalid_expiryexpiry is present but not yyyy-MM-dd.
400expiry_in_pastexpiry 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.
403tier_restrictedYour plan is below Basic. The body includes current_plan and required_plan.
404symbol_not_foundNo market data for the symbol.
429Quota exceededDaily 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 regime to find OPEX names where positioning makes a pin into the close likely
  • Trade only clean signals - act when decision is candidate and skip no_setup reads 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 score to compare distance-to-pain and OI concentration across a universe
  • Size on conviction - scale the clip by score and confidence rather than a fixed lot
  • Respect the guardrails - honor risk_flags[] and require a clean data_quality before fading toward the pin

Related reading

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

Ready to build with FlashAlpha?

Get your free API key and start pulling live options data in 60 seconds.

No credit card required Setup in 60 seconds Secure & reliable