# POST /api/mcp/data/stress-tests

> How does my book hold up in a crash, a vol spike and a melt-up?

Runs the fixed set of scenarios (crash, correction, vol spike, rally and more) on your positions and returns the estimated P&L and contributions for each.

- **Family:** Portfolio risk (https://apexvol.com/developers/risk-api)
- **Plan:** Pro and above. Every call needs `Authorization: Bearer avmcp_<token>`; tokens are issued to paid and trial accounts under Account, then API Access.
- **Units:** As /scenario-analysis.
- **Basis:** Same Greeks-based estimate as /scenario-analysis.
- **MCP tools:** `generate_stress_tests`
- **Background:** https://apexvol.com/learn/options-risk-management

## Parameters

| Name | In | Default | Range | Meaning |
|---|---|---|---|---|
| `positions` (required) | body |  | as /portfolio-greeks | The book. |

## Request

```bash
curl -X POST "https://apexvol.com/api/mcp/data/stress-tests" \
     -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}]}'
```

## Response (captured 2026-09-08)

Real response, lists cut to the rows nearest the money. The envelope is `{"success": true, "data": ...}`.

```json
{
  "success": true,
  "data": {
    "current_value": 76389.0,
    "scenarios": [
      {
        "days_forward": 1,
        "delta_contribution": -28472.4537,
        "estimated_pnl": -28491.5651,
        "estimated_pnl_pct": -37.298,
        "iv_change_pct": 100,
        "new_portfolio_value": 47897.4349,
        "scenario_name": "Market Crash (-20%)",
        "stock_move_pct": -20,
        "theta_contribution": 13.583,
        "vega_contribution": -1102.4875
      },
      {
        "days_forward": 1,
        "delta_contribution": -13089.1178,
        "estimated_pnl": -13237.0642,
        "estimated_pnl_pct": -17.3285,
        "iv_change_pct": 50,
        "new_portfolio_value": 63151.9358,
        "scenario_name": "Sharp Decline (-10%)",
        "stock_move_pct": -10,
        "theta_contribution": 13.583,
        "vega_contribution": -534.6292
      },
      {
        "days_forward": 1,
        "delta_contribution": -5797.5674,
        "estimated_pnl": -6028.1085,
        "estimated_pnl_pct": -7.8913,
        "iv_change_pct": 25,
        "new_portfolio_value": 70360.8915,
        "scenario_name": "Moderate Decline (-5%)",
        "stock_move_pct": -5,
        "theta_contribution": 13.583,
        "vega_contribution": -260.8316
      }
    ],
    "success": true,
    "timestamp": "2026-09-08T08:07:46.937252"
  }
}
```

## Fields

- `scenarios[].scenario_name, stock_move_pct, iv_change_pct, days_forward`: The scenario.
- `scenarios[].estimated_pnl, estimated_pnl_pct`: The outcome.
- `current_value`: Starting value.

## Errors

- `401`: no or revoked token
- `429`: Retry-After seconds
- `403`: Pro plan required
- `400`: missing or malformed body
- Full list: https://apexvol.com/developers/errors

## Ask it in an MCP client

- Stress test my positions.
- How much would I lose in a 10% crash with a vol spike?
- Run the standard stress battery on this book.

Conventions for units, bases and timestamps: https://apexvol.com/developers/conventions
