Structures Greeks API
Aggregate Black-Scholes Greeks across a multi-leg position, with per-leg expiry and implied vol so calendars and diagonals aggregate correctly.
Endpoint
X-Api-Key)
Rate Limited: Yes
Basic+
Request Body Fields
| Name | In | Required | Default | Description |
|---|---|---|---|---|
legs | body | yes | - | One or more legs. Must be non-empty. |
legs[].action | body | yes | buy | buy (alias long) or sell (alias short). |
legs[].type | body | yes | call | call (alias c) or put (alias p). |
legs[].strike | body | yes | - | Strike price. Must be > 0. |
legs[].expiry | body | yes | - | Leg expiry, YYYY-MM-DD. |
legs[].impliedVol | body | yes | - | Implied volatility as a decimal (e.g. 0.28). Must be > 0. |
legs[].quantity | body | no | 1 | Number of contracts. Must be > 0. |
spot | body | yes | - | Underlying spot price priced against. Must be > 0. |
today | body | no | today (UTC) | Valuation date, YYYY-MM-DD. |
rate | body | no | 0.045 | Risk-free rate (decimal). |
dividendYield | body | no | 0.013 | Continuous dividend yield (decimal). |
Request Body
{
"legs": [
{ "action": "buy", "type": "call", "strike": 100, "expiry": "2026-07-17", "impliedVol": 0.28, "quantity": 1 },
{ "action": "sell", "type": "call", "strike": 110, "expiry": "2026-07-17", "impliedVol": 0.25, "quantity": 1 }
],
"spot": 102.5,
"today": "2026-06-05",
"rate": 0.045,
"dividendYield": 0.013
}
curl -X POST "https://lab.flashalpha.com/v1/structures/greeks" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"legs": [
{ "action": "buy", "type": "call", "strike": 100, "expiry": "2026-07-17", "impliedVol": 0.28, "quantity": 1 },
{ "action": "sell", "type": "call", "strike": 110, "expiry": "2026-07-17", "impliedVol": 0.25, "quantity": 1 }
],
"spot": 102.5,
"today": "2026-06-05",
"rate": 0.045,
"dividendYield": 0.013
}'
import requests
resp = requests.post(
"https://lab.flashalpha.com/v1/structures/greeks",
headers={"X-Api-Key": "YOUR_API_KEY"},
json={
"legs": [
{"action": "buy", "type": "call", "strike": 100, "expiry": "2026-07-17", "impliedVol": 0.28, "quantity": 1},
{"action": "sell", "type": "call", "strike": 110, "expiry": "2026-07-17", "impliedVol": 0.25, "quantity": 1},
],
"spot": 102.5,
"today": "2026-06-05",
"rate": 0.045,
"dividendYield": 0.013,
},
)
data = resp.json()
print(f"Position delta: {data['position_greeks']['delta']}")
const resp = await fetch(
"https://lab.flashalpha.com/v1/structures/greeks",
{
method: "POST",
headers: {
"X-Api-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
legs: [
{ action: "buy", type: "call", strike: 100, expiry: "2026-07-17", impliedVol: 0.28, quantity: 1 },
{ action: "sell", type: "call", strike: 110, expiry: "2026-07-17", impliedVol: 0.25, quantity: 1 }
],
spot: 102.5,
today: "2026-06-05",
rate: 0.045,
dividendYield: 0.013
})
}
);
const data = await resp.json();
console.log("Position delta:", data.position_greeks.delta);
This is a pure-math POST endpoint: each Greek is computed analytically from the legs and spot/IV you supply, with no market-data lookup, symbol resolution, or live IV. There is no live Try-It widget for it - run the cURL example above to try it.
Response
{
"spot": 102.5,
"as_of": "2026-06-05T14:32:10.123Z",
"valuation_date": "2026-06-05",
"rate": 0.045,
"dividend_yield": 0.013,
"legs": [
{ "action": "buy", "type": "call", "strike": 100, "expiry": "2026-07-17", "impliedVol": 0.28, "quantity": 1 },
{ "action": "sell", "type": "call", "strike": 110, "expiry": "2026-07-17", "impliedVol": 0.25, "quantity": 1 }
],
"position_greeks": {
"delta": 0.3142,
"gamma": 0.0184,
"theta": -0.0421,
"vega": 0.1163,
"rho": 0.0457,
"vanna": -0.0039,
"charm": 0.0008
}
}
Key Response Fields
| Field | Type | Description |
|---|---|---|
spot | number | Underlying spot price priced against |
as_of | string | Server timestamp of the computation |
valuation_date | string | The resolved today |
rate | number | Risk-free rate used (decimal) |
dividend_yield | number | Continuous dividend yield used (decimal) |
legs | array | Echoes the request body (camelCase field names) |
position_greeks | object | Aggregated delta, gamma, theta, vega, rho, vanna, and charm |
Errors
| Status | Error | When |
|---|---|---|
400 | empty_legs | legs is missing or empty. |
400 | invalid_spot | spot <= 0. |
400 | invalid_action | leg[i].action is not buy/sell (or long/short). |
400 | invalid_type | leg[i].type is not call/put (or c/p). |
400 | invalid_strike | leg[i].strike <= 0. |
400 | invalid_iv | leg[i].impliedVol <= 0. |
400 | invalid_expiry | leg[i].expiry is not a valid YYYY-MM-DD date. |
400 | invalid_quantity | leg[i].quantity <= 0. |
403 | tier_restricted | Free plan. Requires Basic or higher. |
About
This endpoint is part of the Structures family of pure-math multi-leg utilities. Every result is a deterministic function of the legs you supply: there is no market-data lookup, no symbol resolution, and no live IV. You pass the legs and the spot/IV you want priced against, and the response is computed analytically.
Each Greek is signed for direction (long +, short −) and scaled by quantity, then summed across legs. Because every leg carries its own expiry and implied vol, calendars and diagonals aggregate correctly. Legs that have already expired relative to today contribute zero.
Common Use Cases
- Read net
position_greeks.deltato see directional exposure and hedge a multi-leg trade to the share count you want - Watch
position_greeks.gammato size how fast that delta shifts as spot moves, so you know how often to rebalance - Track
position_greeks.thetafor daily time-decay carry and confirm a short-premium structure is collecting as intended - Use
position_greeks.vegato quantify IV exposure and gate the trade on your volatility view - Aggregate Greeks correctly across calendars and diagonals because each leg carries its own
expiryandimpliedVol - Stress the position by re-POSTing with alternative
spotorimpliedVolto map the Greeks across scenarios - Surface higher-order
vannaandcharmin a risk panel to anticipate delta drift from vol and time
Related
Related reading
- Options greeks API: real-time delta, gamma, theta, vega - what each aggregated Greek means
- Position sizing: build a Kelly-criterion calculator - turn these Greeks into a sizing decision
Complementary endpoints
- Structure P&L - pair these Greeks with the at-expiry payoff for the same legs
- Option Quote - source live spot and per-leg IV to feed this call
- Exposure Sheet - see how the same Greeks roll up across a whole book
Ready to build?
Get your free API key and start pulling live options data in 30 seconds.