1. API
  2. Recipes
  3. Portfolio Greeks check

Recipe, one Python file

Portfolio Greeks check

Net delta, theta and vega for a small book, then the same book through the standard stress scenarios. Builds a two-position book from live quotes (long stock plus a short 30-delta put priced from the chain), posts it to the portfolio Greeks endpoint, then runs the stress tests. The output is the net Greeks, the risk label, and the estimated profit and loss in each crash, rally and vol-shock scenario.

3Endpoints it calls
ProPlan and above, from $55/mo
2026-09-08Output captured

What it prints

The output,
as captured.

Run against the live API on 2026-09-08 with a real token. Anyone holding more than one options position who wants the aggregate risk in numbers, not a feeling.

python3 portfolio_greeks_check.pystdout, 2026-09-08
Book: long 100 SPY at 767.37, short 1 SPY 766 put 2026-09-08 at 0.69
net delta 133.6   theta 0.00/day   vega 0.0   value $76,668   risk LOW

scenario                    stock    IV days      P&L $   P&L %
Market Crash (-20%)           -20  +100    1    -30,465   -39.7
Sharp Decline (-10%)          -10   +50    1    -15,117   -19.7
Moderate Decline (-5%)         -5   +25    1     -7,444    -9.7
Sideways + Time                +0    +0    7         69     0.1
Moderate Rally (+5%)           +5   -15    1      3,906     5.1
Strong Rally (+10%)           +10   -25    1      7,743    10.1
IV Crush (-50%)                +0   -50    1         69     0.1
IV Spike (+100%)               +0  +100    1         69     0.1

The script

One file,
requests and nothing else.

Set APEXVOL_API_TOKEN from Account, then API Access, and run it. The token is the only configuration.

portfolio_greeks_check.pyPython 3.10+, pip install requests
import os
import sys

import requests

# One token, any paid or trial plan: Account, then API Access.
TOKEN = os.environ.get("APEXVOL_API_TOKEN") or sys.exit("set APEXVOL_API_TOKEN")
BASE = os.environ.get("APEXVOL_API_URL", "https://apexvol.com") + "/api/mcp/data"
S = requests.Session()
S.headers["Authorization"] = f"Bearer {TOKEN}"


def get(path, **params):
    r = S.get(BASE + path, params=params, timeout=90)
    body = r.json()
    if not body.get("success"):
        sys.exit(f"{path}: HTTP {r.status_code}: {body.get('error')}")
    return body["data"]


def post(path, body):
    r = S.post(BASE + path, json=body, timeout=90)
    out = r.json()
    if not out.get("success"):
        sys.exit(f"{path}: HTTP {r.status_code}: {out.get('error')}")
    return out["data"]

put = get("/options-by-delta/SPY", delta=0.30, option_type="put")
spot = put["stock_price"]
positions = [
    {"ticker": "SPY", "position_type": "STOCK", "quantity": 100, "current_price": spot},
    {"ticker": "SPY", "position_type": "PUT", "quantity": -1, "strike": put["strike"],
     "expiration": put["expiration"], "current_price": put["mid"],
     "delta": -abs(put["actual_delta"]), "iv": put["iv"]},
]
greeks = post("/portfolio-greeks", {"positions": positions})
ps = greeks["portfolio_summary"]
print(f"Book: long 100 SPY at {spot:,.2f}, short 1 SPY {put['strike']:,.0f} put {put['expiration']} at {put['mid']:.2f}")
print(f"net delta {ps['total_delta']:,.1f}   theta {ps['total_theta']:,.2f}/day   vega {ps['total_vega']:,.1f}   "
      f"value ${ps['total_value']:,.0f}   risk {ps['risk_level']}")
print()
stress = post("/stress-tests", {"positions": positions})
print(f"{'scenario':26}{'stock':>7}{'IV':>6}{'days':>5}{'P&L $':>11}{'P&L %':>8}")
for sc in stress["scenarios"]:
    print(f"{sc['scenario_name']:26}{sc['stock_move_pct']:>+7.0f}{sc['iv_change_pct']:>+6.0f}{sc['days_forward']:>5}"
          f"{sc['estimated_pnl']:>11,.0f}{sc['estimated_pnl_pct']:>8.1f}")

How it works

1. Price the put
GET /options-by-delta/SPY?delta=0.30&option_type=put returns the real contract nearest that delta.
2. Post the book
POST /portfolio-greeks with positions[] returns the net Greeks and a risk label.
3. Stress it
POST /stress-tests runs the same positions through the standard scenarios.

Schedule it

cron
30 20 * * 1-5 APEXVOL_API_TOKEN=avmcp_... python3 portfolio_greeks_check.py
16:30 New York, after the close. Times in the crontab are UTC.
Claude Code
/loop 1d python3 portfolio_greeks_check.py
Runs it on an interval inside a session, and the assistant reads the output each time.

The same job, no code

Ask an assistant
with the MCP server.

Connect the ApexVol MCP server and this recipe is one prompt. It ships in the client's prompt picker as recipe-portfolio-greeks-check.

In Claude, Cursor or ChatGPTthrough the MCP server
You

I am long 100 SPY and short one 30-delta put in the nearest monthly expiration. What are my net Greeks, and how does the book do in a 10 percent drop with vol up 50 percent?

The assistant calls get_options_by_delta, calculate_portfolio_greeks, generate_stress_tests and answers from the same JSON the script prints.

Set it up in:

Under the hood

3 endpoints,
one token.

Each card opens the endpoint's page: parameters and bounds, every field, a real response and a console that runs it on your ticker.

Access

Plan
Pro and above. Every endpoint follows the tier of its web feature; the chips on the cards say which.
Cost
Measured in upstream data requests against the monthly allowance, not calls; a batch call counts one rate-limit unit and one data request per symbol. GET /api/mcp/data/me/usage shows the meter.
Reference
The rate-limits guide, the conventions and the error model. The whole API as one Markdown file: /llms-full.txt.

Included with
every paid plan.

From $55 a month. Create a token under Account, then API Access, and this script runs as it is.

Real market data, not a sandbox. See it live on AAPL.

7 days free, cancel anytime Card required · no charge for 7 days
Start trial →