Structures Greeks API - Aggregate Position Greeks | FlashAlpha
  1. Position Greeks

Position 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

POST /v1/structures/greeks
Auth required (X-Api-Key) Rate Limited: Yes Plan: Basic+

Request Body Fields

Name In Type Required Default Description
legsbodyarrayrequired - One or more legs. Must be non-empty.
legs[].actionbodyenumrequiredbuybuy (alias long) or sell (alias short).
legs[].typebodyenumrequiredcallcall (alias c) or put (alias p).
legs[].strikebodynumberrequired - Strike price. Must be > 0.
legs[].expirybodydaterequired - Leg expiry, yyyy-MM-dd.
legs[].impliedVolbodynumberrequired - Implied volatility as a decimal (e.g. 0.28). Must be > 0.
legs[].quantitybodyinteger1Number of contracts. Must be > 0.
spotbodynumberrequired - Underlying spot price priced against. Must be > 0.
todaybodydatetoday (UTC)Valuation date, yyyy-MM-dd.
ratebodynumber0.045Risk-free rate (decimal).
dividendYieldbodynumber0.013Continuous dividend yield (decimal).

Request

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,
    },
)
resp.raise_for_status()
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
    })
  }
);
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
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

Example
{
  "spot": 102.5,
  "as_of": "2026-10-30T13:46:27.9572651Z",
  "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.407241,
    "gamma": 0.003864,
    "theta": -0.01542,
    "vega": 0.025654,
    "rho": 4.3056,
    "vanna": -1.3393,
    "charm": -0.004086
  },
  "endpoint_version": "2026.09.30",
  "data_as_of": {
    "node": "fa4",
    "equity_feed": "2026-10-30T13:46:27.708Z",
    "equity_options_feed": "2026-10-30T13:46:26Z",
    "index_feed": "2026-10-30T13:46:26.1488076Z",
    "index_options_feed": "2026-10-30T13:46:24Z",
    "futures_feed": "2026-10-30T13:46:22.778Z",
    "futures_options_feed": "2026-10-30T13:46:20.351Z",
    "flow_feed": "2026-10-30T13:46:00Z",
    "oi_feed": "2026-10-29T20:00:00Z",
    "macro_feed": "2026-10-29T21:00:20Z"
  }
}

Response Fields

Field Type Description
spotnumberUnderlying spot price priced against
as_ofstringServer timestamp of the computation
valuation_datestringThe resolved today
ratenumberRisk-free rate used (decimal)
dividend_yieldnumberContinuous dividend yield used (decimal)
legsarrayEchoes the request body (camelCase field names)
position_greeksobjectAggregated delta, gamma, theta, vega, rho, vanna, and charm
legs[].actionstringbuy (alias long) or sell (alias short).
legs[].typestringcall (alias c) or put (alias p).
legs[].strikenumberStrike price. Must be > 0.
legs[].expirystringLeg expiry, yyyy-MM-dd.
legs[].impliedVolnumberImplied volatility as a decimal (e.g. 0.28). Must be > 0.
legs[].quantitynumberNumber of contracts. Must be > 0.
position_greeks.deltanumberPosition greeks: delta
position_greeks.gammanumberPosition greeks: gamma
position_greeks.thetanumberPosition greeks: theta
position_greeks.veganumberPosition greeks: vega
position_greeks.rhonumberPosition greeks: rho
position_greeks.vannanumberPosition greeks: vanna
position_greeks.charmnumberPosition greeks: charm
endpoint_version, data_as_ofstring, objectResponse envelope, see Response envelope.

Errors

Status Error When
400empty_legslegs is missing or empty.
400invalid_spotspot <= 0.
400invalid_actionleg[i].action is not buy/sell (or long/short).
400invalid_typeleg[i].type is not call/put (or c/p).
400invalid_strikeleg[i].strike <= 0.
400invalid_ivleg[i].impliedVol <= 0.
400invalid_expiryleg[i].expiry is not a valid yyyy-MM-dd date.
400invalid_quantityleg[i].quantity <= 0.
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.
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

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.delta to see directional exposure and hedge a multi-leg trade to the share count you want
  • Watch position_greeks.gamma to size how fast that delta shifts as spot moves, so you know how often to rebalance
  • Track position_greeks.theta for daily time-decay carry and confirm a short-premium structure is collecting as intended
  • Use position_greeks.vega to quantify IV exposure and gate the trade on your volatility view
  • Aggregate Greeks correctly across calendars and diagonals because each leg carries its own expiry and impliedVol
  • Stress the position by re-POSTing with alternative spot or impliedVol to map the Greeks across scenarios
  • Surface higher-order vanna and charm in a risk panel to anticipate delta drift from vol and time

Related reading

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 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