- API
- Portfolio risk
- Scenario analysis
Portfolio risk API, POST /scenario-analysis
What happens to my book if SPY drops 5% and IV rises 20% over 5 days?
Estimated P&L for your positions under the scenarios you specify. For each scenario (stock move, IV change, days forward) returns the estimated P&L in dollars and percent, split into delta, vega and theta contributions, and the new portfolio value.
The answer, in one call
Units first,
then the request.
stock_move_pct and iv_change_pct in percent; P&L in dollars.
First-order Greeks-based estimate from the Greeks you pass; not a full re-pricing.
curl -X POST "https://apexvol.com/api/mcp/data/scenario-analysis" \
-H "Authorization: Bearer avmcp_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"positions": [{"ticker": "SPY", "position_type": "STOCK", "quantity": 100, "current_price": 770.25}, {"ticker": "SPY", "position_type": "PUT", "quantity": -1, "strike": 755.0, "expiration": "2026-10-09", "current_price": 6.359999999999999, "delta": -0.3014, "theta": -0.1785, "vega": 0.8379, "iv": 0.1365}], "scenarios": [{"stock_move_pct": -5, "iv_change_pct": 20, "days_forward": 5}]}'
import requests
headers = {"Authorization": "Bearer avmcp_YOUR_TOKEN"}
body = {"positions": [{"ticker": "SPY", "position_type": "STOCK", "quantity": 100, "current_price": 770.25}, {"ticker": "SPY", "position_type": "PUT", "quantity": -1, "strike": 755.0, "expiration": "2026-10-09", "current_price": 6.359999999999999, "delta": -0.3014, "theta": -0.1785, "vega": 0.8379, "iv": 0.1365}], "scenarios": [{"stock_move_pct": -5, "iv_change_pct": 20, "days_forward": 5}]}
r = requests.post("https://apexvol.com/api/mcp/data/scenario-analysis", headers=headers, json=body)
r.raise_for_status()
data = r.json()["data"]
print(data["current_value"])
What happens to my positions if SPY falls 5% and IV jumps 20% in 5 days?
The assistant calls run_scenario_analysis and answers from the JSON below.{
"success": true,
"data": {
"current_value": 76389.0,
"scenarios": [
{
"days_forward": 5,
"delta_contribution": -5797.5674,
"estimated_pnl": -5928.2762,
"estimated_pnl_pct": -7.7606,
"iv_change_pct": 20,
"new_portfolio_value": 70460.7238,
"scenario_name": "+-5% stock, 20% IV",
"stock_move_pct": -5,
"theta_contribution": 70.2965,
"vega_contribution": -207.3894
}
],
"success": true,
"timestamp": "2026-09-08T08:07:45.686052"
}
}
Every response is wrapped as {"success": true, "data": {...}}. Lists in the sample are cut to a few rows so it fits on a page; the shape is exactly what your code receives.
Parameters
Bounded,
and the bounds are stated.
Out-of-range numbers are clamped to the documented range, never silently changed to something else. A missing required field returns 400 with the reason.
| Name | In | Default | Range | Meaning |
|---|---|---|---|---|
positions required | body | as /portfolio-greeks | The book. | |
scenarios | body | [] | array of {stock_move_pct, iv_change_pct, days_forward} | What to test. |
Field by field
What each
number means.
scenarios[].estimated_pnl, estimated_pnl_pct- The outcome.
scenarios[].delta_contribution, vega_contribution, theta_contribution- What drove it.
current_value, scenarios[].new_portfolio_value- Before and after.
Access, limits, errors
Before the
first call.
- Plan
- Pro Pro and above. Tokens are issued to paid and trial accounts from $55 a month; each endpoint follows the tier of its web feature. An endpoint above your plan answers 402 and names the plan it needs.
- Auth
- Bearer token, prefix
avmcp_, created under Account, then API Access. Shown once, hashed at rest, rotates in one click. Always callhttps://apexvol.com, never www. - Limits
- 60 requests a minute and 1,000 an hour per token, plus a monthly allowance by plan. Every response carries the remaining counts in
X-RateLimit-*headers; a 429 carriesRetry-Afterin seconds. - Errors
401no or revoked token;429Retry-After seconds;403Pro plan required;400missing or malformed body. The full list with payload shapes is on the errors page.- Since
- API 1.0. Units, bases and timestamps follow the conventions shared by every endpoint; changes are logged in the API changelog.
- Machine-readable
- This page as Markdown, the family as one file, the whole API as llms-full.txt or OpenAPI 3.1.
The same data, in plain English
Ask for it
in an MCP client.
Connect the ApexVol MCP server and the assistant calls run_scenario_analysis by name. One URL, a sign-in, no token to paste.
What happens to my positions if SPY falls 5% and IV jumps 20% in 5 days?
YouRun a +3% / -10 vol scenario on my NVDA book.
YouShow P&L for three scenarios on these positions.
More in the prompt library. Set the server up in Claude Desktop, Claude Code, Cursor, ChatGPT, VS Code, Windsurf or Gemini CLI.
Included with
every paid plan.
From $55 a month, tier-matched: your token queries the data your plan includes and Pro unlocks the full surface.
Real market data, not a sandbox. See it live on AAPL.