# Derivatives Pricer – Portfolio Scenario Reprice

> Derivatives Pricer – Portfolio Scenario Reprice is a paid API for AI agents from derivatives-pricer-production.up.railway.app, paid per call via x402, $0.25/call, status unknown (last checked 2026-10-12).

Reprices a multi-leg options portfolio under one or more spot/vol/time-decay scenarios using Black-Scholes, returning base and shocked MTM plus full analytic Greeks for each scenario.

## Facts

- Endpoint: POST https://derivatives-pricer-production.up.railway.app/v1/portfolio/scenario?utm_source=zero.xyz
- Price: $0.25/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/derivatives-pricer-portfolio-scenario-reprice-793389bd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3dzd8ZiD0okEQUxRuVSCR

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability derivatives-pricer-portfolio-scenario-reprice-793389bd -d '<json body>'
```

Example prompt: Stress test my two-leg options portfolio — I'm long 10 calls (spot 100, strike 105, 30-day expiry, 25% vol) and short 5 puts (spot 100, strike 95, 30-day expiry, 20% vol) — and show me what happens to MTM and Greeks under a 10% spot drop and a 20% relative vol spike with 1 day of time decay.

## When to prefer this

Use this endpoint when you need to evaluate how a multi-leg options portfolio behaves under hypothetical market moves — combining spot shocks, vol shocks, and time decay in a single call. Prefer this over the single-option pricer when you need net portfolio Greeks or want to compare multiple stress scenarios at once. Best for risk managers, quant agents, and algo traders who need fast, analytic (not Monte Carlo) scenario analysis without managing API keys.

## Known failure modes

- Missing required position fields (underlying, strike, timeToExpiry, optionType, quantity, volatility) returns 422 validation error
- Zero quantity on a position rejected with validation error
- Negative strike or underlying rejected (exclusiveMinimum: 0)
- No scenarios provided (minItems: 1) returns validation error
- More than 20 scenarios (maxItems: 20) returns validation error
- Insufficient USDC balance or failed x402 payment returns 402 Payment Required
- Malformed JSON body returns 400 Bad Request

## How this service works

x402-paid Black-Scholes European option pricing, Greeks, IV surfaces, price/scenario on submitted smiles (TV bilinear), portfolio risk, free demo, and MCP. USDC exact on Solana (PayAI) and/or Base (CDP when configured). Receive wallets appear only in HTTP 402, never on free discovery.

## Output

Returns a JSON object with a `base` block containing portfolio MTM and aggregate Greeks (delta, gamma, vega, theta, rho), plus a `scenarios` array where each entry includes the scenario name, applied shocks, shocked MTM, MTM change versus base, and shocked Greeks. Also includes requestId, computedAt timestamp, positionCount, and scenarioCount.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "rate": {
   "type": "number"
  },
  "positions": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "underlying",
     "strike",
     "timeToExpiry",
     "optionType",
     "quantity",
     "volatility"
    ],
    "properties": {
     "strike": {
      "type": "number",
      "exclusiveMinimum": 0
     },
     "quantity": {
      "type": "number",
      "description": "Position size; >0 long, <0 short; must be non-zero"
     },
     "optionType": {
      "enum": [
       "call",
       "put"
      ],
      "type": "string"
     },
     "underlying": {
      "type": "number",
      "description": "Underlying S for this leg",
      "exclusiveMinimum": 0
     },
     "volatility": {
      "type": "number",
      "description": "Annualized vol σ for this leg",
      "exclusiveMinimum": 0
     },
     "timeToExpiry": {
      "type": "number",
      "minimum": 0
     }
    },
    "additionalProperties": false
   },
   "minItems": 1
  },
  "scenarios": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "volShock": {
      "type": "number",
      "description": "Relative vol move; newσ = σ*(1+volShock)"
     },
     "spotShock": {
      "type": "number",
      "description": "Relative spot move; newS = S*(1+spotShock)"
     },
     "timeDecayDays": {
      "type": "number",
      "minimum": 0,
      "description": "Calendar days of time decay; T reduced by days/365"
     }
    },
    "additionalProperties": false
   },
   "maxItems": 20,
   "minItems": 1
  },
  "optionStyle": {
   "enum": [
    "european",
    "american"
   ],
   "type": "string",
   "default": "european",
   "description": "Exercise style (default \"european\")."
  },
  "dividendYield": {
   "type": "number",
   "minimum": 0
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "base": {
   "mtm": 47.16439511,
   "greeks": {
    "rho": 858.77721991,
    "vega": 176.68540458,
    "delta": 9.05941615,
    "gamma": 0.09736793,
    "theta": -58.62185203
   }
  },
  "requestId": "00000000-0000-4000-8000-000000000005",
  "scenarios": [
   {
    "mtm": -37.85755566,
    "name": "spot_down_10",
    "greeks": {
     "rho": 747.49532487,
     "vega": 201.29852574,
     "delta": 7.8848641,
     "gamma": 0.13279827,
     "theta": -55.98280497
    },
    "shocks": {
     "volShock": 0,
     "spotShock": -0.1,
     "timeDecayDays": 0
    },
    "mtmChange": -85.02195077
   },
   {
    "mtm": 53.31386329,
    "name": "vol_up_20pct_rel",
    "greeks": {
     "rho": 830.99263852,
     "vega": 178.51169933,
     "delta": 8.86589449,
     "gamma": 0.08214409,
     "theta": -60.74906514
    },
    "shocks": {
     "volShock": 0.2,
     "spotShock": 0,
     "timeDecayDays": 1
    },
    "mtmChange": 6.14946818
   }
  ],
  "computedAt": "2026-01-01T00:00:00.000Z",
  "positionCount": 2,
  "scenarioCount": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/derivatives-pricer-portfolio-scenario-reprice-793389bd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from derivatives-pricer-production.up.railway.app](https://www.zero.xyz/host/derivatives-pricer-production.up.railway.app/llms.txt)
