> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chicago.global/llms.txt
> Use this file to discover all available pages before exploring further.

# Portfolio Risk

> Full instantaneous single-currency repricing from supplied vanilla inputs (synchronous). Always includes a zero-shock baseline. Supplied scenarios report full model P&L and measured spot-only delta-gamma residuals, never guaranteed bounds. No live data, historical performance, FX, cash dividends or expiry settlement.

Full instantaneous, single-currency repricing of a portfolio of supplied
vanilla positions (stocks, ETFs, and European or American options), from
caller-supplied spot and implied-vol inputs. **Synchronous** — no job ID.

> [!WARNING]
>
> This never substitutes option deltas into historical returns, and uses no
> live market data. Every price and Greek comes from what you send in the
> request. A `baseline` scenario (no shocks) is always included alongside any
> scenarios you supply.

## Request Body

| Field | Type | Required | Description |
| - | - | - | - |
| `valuation_date` | string (date) | Yes | As-of date for the repricing. |
| `currency` | string | Yes | 3-letter currency code. Must match every position's `currency`. |
| `nav` | number | Yes | Portfolio NAV, must be positive. |
| `positions` | array of `Holding` | Yes | 1–100 positions. Position `id` values must be unique. |
| `scenarios` | array of `Scenario` | No | 0–20 scenarios. IDs must be unique and not `baseline` (reserved). |

**`Holding` object:**

| Field | Type | Required | Description |
| - | - | - | - |
| `id` | string | Yes | Caller-assigned position identifier, unique within the request. |
| `asset_type` | string | Yes | `stock`, `etf`, or `option`. |
| `underlying` | string | Yes | RIC of the underlying. |
| `quantity` | number | Yes | Signed position size. Integer-valued for options. |
| `spot` | number | Yes | Spot price, must be positive. Positions sharing an `underlying` must share the same `spot`. |
| `currency` | string | Yes | 3-letter code, must match the request's `currency`. |
| `option` | `Contract` object | Required only when `asset_type` is `option` | Option terms (see below). |

**`Contract` object** (option terms). Every field below is required whenever
`option` is present; there are no optional or defaulted fields in this object:

| Field | Type | Description |
| - | - | - |
| `option_type` | string | `call` or `put`. |
| `option_style` | string | `european` or `american`. |
| `strike` | number | Positive. |
| `expiration` | string (date) | Must be after `valuation_date`. |
| `implied_vol` | number | Positive. |
| `risk_free_rate` | number | |
| `dividend_yield` | number | |
| `contract_size` | integer | 1–100,000. |
| `settlement_type` | string | `am` or `pm`. |
| `underlying_type` | string | `equity`, `index`, or `etf`. |
| `payoff_type` | string | `vanilla` (only value accepted). |
| `deliverable_type` | string | `standard` (only value accepted). |
| `dividend_model` | string | `continuous_yield` (only value accepted). |
| `price_unit` | string | `per_underlying_unit` (only value accepted). |

**`Scenario` object:**

| Field | Type | Required | Description |
| - | - | - | - |
| `id` | string | Yes | Unique, not `baseline`. |
| `spot_shocks` | object | No | Map of underlying RIC to fractional spot shock (must exceed `-1`). Up to 100 entries. |
| `vol_shocks` | object | No | Map of underlying RIC to additive implied-vol shock. Up to 100 entries. |

> [!NOTE]
>
> Request-size caps: positions × (scenarios + 1) ≤ 500 position-scenarios, and
> American-style option valuations ≤ 40 across the request (scaled by
> scenario count). A scenario naming an underlying not in `positions` is
> rejected.

## Response

Every position, in every scenario, carries `base_greeks` and `position_risk`,
whether it's a stock, ETF, or option. If no position has `asset_type: "option"`,
these are computed directly (exact stock arithmetic) and come out trivial
for stocks and ETFs (delta 1, all other Greeks 0, as in the example below).
With any option position, every position in the request is priced through
the same options-pricing path instead, so Greeks stay additive across the
book.

```json theme={null}
{
  "schema_version": 1,
  "valuation_date": "2026-11-04",
  "currency": "USD",
  "nav": 1000000,
  "assumptions": [
    "instantaneous",
    "single_currency_no_fx_conversion",
    "whole_day_actual_365",
    "continuous_dividend_yield",
    "flat_rates",
    "fixed_strike_additive_volatility",
    "model_to_model_pnl",
    "no_constituent_lookthrough"
  ],
  "market_status": "not_checked",
  "underlying_exposures": [
    { "underlying": "AAPL.O", "delta_equivalent_units": 500, "dollar_delta": 95000, "delta_weight": 0.095 }
  ],
  "scenarios": [
    {
      "id": "baseline",
      "total_pnl": 0,
      "pnl_fraction_nav": 0,
      "delta_gamma_pnl": 0,
      "approximation_residual": 0,
      "approximation_status": "measured_spot_only_residual_not_bound",
      "positions": [
        {
          "position_id": "pos-1",
          "underlying": "AAPL.O",
          "asset_type": "stock",
          "quantity": 500,
          "multiplier": 1,
          "base_price": 190,
          "base_greeks": { "delta": 1, "gamma": 0, "vega": 0, "theta": 0, "rho": 0 },
          "position_risk": { "delta_equivalent_units": 500, "dollar_delta": 95000, "gamma_per_price_unit_squared": 0, "vega_per_vol_point": 0, "theta_per_calendar_day": 0, "rho_per_rate_point": 0 },
          "scenario_price": 190,
          "pnl": 0,
          "delta_gamma_pnl": 0
        }
      ]
    }
  ],
  "input_source": "caller_supplied_unverified",
  "positions": [ { "id": "pos-1", "asset_type": "stock", "underlying": "AAPL.O", "quantity": 500, "spot": 190, "currency": "USD", "option": null } ]
}
```

With an option position, each scenario's `positions[]` row also carries
`contract_eligibility` and `pricing_diagnostics`; see the response example
for exact field presence, which varies by position.

## Errors

| Status | Code | When |
| - | - | - |
| `422` | `invalid_pricing_inputs` | Request fails pricing validation. |
| `422` | `pricing_unresolved` | A price could not be resolved; `pricing_diagnostics` explains why. |
| `503` | `pricing_unavailable` | Option pricing is unavailable (option positions only; stock-only requests are unaffected). |


## OpenAPI

````yaml POST /v1/portfolio/risk
openapi: 3.1.0
info:
  title: Parallax API
  description: >-
    Parallax by Chicago Global — AI-powered investment research and portfolio
    analytics. Multi-factor scoring, portfolio analysis and tracking, financial
    statements, analyst estimates, ETF analytics, valuation (DCF & multiples),
    macro and market telemetry, and AI-generated research reports. Credits can
    be fractional. Per-symbol reads cost 0.05 credits per submitted symbol; see
    each operation for its price. A 503 indicates an availability failure, not
    data age.
  version: 2.0.0
servers:
  - url: https://api.chicago.global
security:
  - HTTPBearer: []
paths:
  /v1/portfolio/risk:
    post:
      tags:
        - v1
        - Portfolio
      summary: Portfolio Risk
      description: >-
        Full instantaneous single-currency repricing from supplied vanilla
        inputs (synchronous). Always includes a zero-shock baseline. Supplied
        scenarios report full model P&L and measured spot-only delta-gamma
        residuals, never guaranteed bounds. No live data, historical
        performance, FX, cash dividends or expiry settlement.
      operationId: portfolio_risk_v1_portfolio_risk_post
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - valuation_date
                - currency
                - nav
                - positions
              properties:
                valuation_date:
                  type: string
                  format: date
                  title: Valuation Date
                currency:
                  type: string
                  pattern: ^[A-Z]{3}$
                  title: Currency
                nav:
                  type: number
                  exclusiveMinimum: 0
                  title: Nav
                positions:
                  type: array
                  minItems: 1
                  maxItems: 100
                  title: Positions
                  items:
                    type: object
                    required:
                      - id
                      - asset_type
                      - underlying
                      - quantity
                      - spot
                      - currency
                    properties:
                      id:
                        type: string
                        minLength: 1
                        maxLength: 128
                      asset_type:
                        type: string
                        enum:
                          - stock
                          - etf
                          - option
                      underlying:
                        type: string
                      quantity:
                        type: number
                      spot:
                        type: number
                        exclusiveMinimum: 0
                      currency:
                        type: string
                        pattern: ^[A-Z]{3}$
                      option:
                        anyOf:
                          - type: object
                            properties:
                              option_type:
                                type: string
                                enum:
                                  - call
                                  - put
                              option_style:
                                type: string
                                enum:
                                  - european
                                  - american
                              strike:
                                type: number
                                exclusiveMinimum: 0
                              expiration:
                                type: string
                                format: date
                              implied_vol:
                                type: number
                                exclusiveMinimum: 0
                              risk_free_rate:
                                type: number
                              dividend_yield:
                                type: number
                              contract_size:
                                type: integer
                                exclusiveMinimum: 0
                                maximum: 100000
                              settlement_type:
                                type: string
                                enum:
                                  - am
                                  - pm
                              underlying_type:
                                type: string
                                enum:
                                  - equity
                                  - index
                                  - etf
                              payoff_type:
                                type: string
                                enum:
                                  - vanilla
                              deliverable_type:
                                type: string
                                enum:
                                  - standard
                              dividend_model:
                                type: string
                                enum:
                                  - continuous_yield
                              price_unit:
                                type: string
                                enum:
                                  - per_underlying_unit
                            required:
                              - option_type
                              - option_style
                              - strike
                              - expiration
                              - implied_vol
                              - risk_free_rate
                              - dividend_yield
                              - contract_size
                              - settlement_type
                              - underlying_type
                              - payoff_type
                              - deliverable_type
                              - dividend_model
                              - price_unit
                          - type: 'null'
                        default: null
                scenarios:
                  type: array
                  maxItems: 20
                  default: []
                  title: Scenarios
                  items:
                    type: object
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        minLength: 1
                        maxLength: 128
                      spot_shocks:
                        type: object
                        additionalProperties:
                          type: number
                        maxProperties: 100
                        default: {}
                      vol_shocks:
                        type: object
                        additionalProperties:
                          type: number
                        maxProperties: 100
                        default: {}
              title: PortfolioRiskRequest
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: invalid_pricing_inputs or pricing_unresolved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
        '503':
          description: pricing_unavailable — option pricing unavailable
      security:
        - HTTPBearer: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.