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

# Options Skills

> Reference for options.greeks and options.implied_vol — pure computed Black-Scholes options skills exposed to AI agents.

Options skills are **pure computed analytics** — they take agent-supplied inputs (no archive reads) and run Black-Scholes math. This makes them deterministic, instant, and free of provenance caveats. The [provenance envelope](/skills/overview#the-provenance-envelope) returns `source: "computed"` with `lag_seconds: 0`.

<Callout type="info">
  Because these skills don't touch the archive, the agent supplies every input. Use `vol.term_structure` or `market.quote` first if you need market IV or spot.
</Callout>

## Skill summary

| Skill ID              | Tool name             | Source   | Runtime     | Description                                      |
| --------------------- | --------------------- | -------- | ----------- | ------------------------------------------------ |
| `options.greeks`      | `options_greeks`      | computed | interactive | Black-Scholes price + delta/gamma/vega/theta/rho |
| `options.implied_vol` | `options_implied_vol` | computed | interactive | BS implied vol from observed option price        |

***

## options.greeks

Black-Scholes option price and full greek set.

**Arguments**

| Name    | Type   | Required | Default | Description                                        |
| ------- | ------ | -------- | ------- | -------------------------------------------------- |
| `S`     | float  | yes      | —       | Spot price                                         |
| `K`     | float  | yes      | —       | Strike price                                       |
| `T`     | float  | yes      | —       | Time to expiry in years (e.g. `0.25` for 3 months) |
| `sigma` | float  | yes      | —       | Implied volatility (decimal, e.g. `0.30`)          |
| `r`     | float  | no       | `0.04`  | Risk-free rate (decimal)                           |
| `q`     | float  | no       | `0.0`   | Continuous dividend yield (decimal)                |
| `type`  | string | no       | `call`  | `call` or `put`                                    |

**Formulas**

| Output       | Formula                                                                          |
| ------------ | -------------------------------------------------------------------------------- |
| `d1`         | `(ln(S/K) + (r − q + σ²/2)T) / (σ√T)`                                            |
| `d2`         | `d1 − σ√T`                                                                       |
| `call_price` | `S·e^(−qT)·N(d1) − K·e^(−rT)·N(d2)`                                              |
| `put_price`  | `K·e^(−rT)·N(−d2) − S·e^(−qT)·N(−d1)`                                            |
| `delta`      | call: `e^(−qT)·N(d1)`; put: `−e^(−qT)·N(−d1)`                                    |
| `gamma`      | `e^(−qT)·φ(d1) / (S·σ·√T)`                                                       |
| `vega`       | `S·e^(−qT)·φ(d1)·√T` (per 1.00 vol)                                              |
| `theta`      | call: `(−S·e^(−qT)·φ(d1)·σ/(2√T) − r·K·e^(−rT)·N(d2) + q·S·e^(−qT)·N(d1)) / 365` |
| `rho`        | call: `K·T·e^(−rT)·N(d2) / 100`                                                  |

**Example**

```json theme={null}
options_greeks({ "S": 128.42, "K": 130, "T": 0.0822, "sigma": 0.42, "r": 0.045, "type": "call" })
```

```json theme={null}
{
  "skill_id": "options.greeks",
  "data": {
    "inputs": { "S": 128.42, "K": 130, "T": 0.0822, "sigma": 0.42, "r": 0.045, "q": 0.0, "type": "call" },
    "price": 5.18,
    "greeks": { "delta": 0.521, "gamma": 0.038, "vega": 0.182, "theta": -0.087, "rho": 0.044 },
    "d1": 0.052, "d2": -0.068
  },
  "provenance": { "source": "computed", "freshness": { "as_of": "2025-06-27T20:00:00Z", "lag_seconds": 0 }, "cost": { "credits": 1, "tier": "free" }, "warnings": [] }
}
```

<Tip>
  `vega` is reported per 1.00 (100%) change in vol. Divide by 100 for per-percentage-point sensitivity. `theta` is reported per calendar day.
</Tip>

***

## options.implied\_vol

Black-Scholes implied volatility backed out from an observed option price. Uses Brent's method on the BS pricing function.

**Arguments**

| Name       | Type   | Required | Default | Description               |
| ---------- | ------ | -------- | ------- | ------------------------- |
| `S`        | float  | yes      | —       | Spot price                |
| `K`        | float  | yes      | —       | Strike price              |
| `T`        | float  | yes      | —       | Time to expiry in years   |
| `price`    | float  | yes      | —       | Observed option price     |
| `r`        | float  | no       | `0.04`  | Risk-free rate            |
| `q`        | float  | no       | `0.0`   | Continuous dividend yield |
| `type`     | string | no       | `call`  | `call` or `put`           |
| `tol`      | float  | no       | `1e-6`  | Solver tolerance          |
| `max_iter` | int    | no       | `100`   | Max iterations            |

**What it computes**: finds `sigma` such that `BS(S, K, T, sigma, r, q, type) = price`.

**Example**

```json theme={null}
options_implied_vol({ "S": 128.42, "K": 130, "T": 0.0822, "price": 5.18, "r": 0.045, "type": "call" })
```

```json theme={null}
{
  "skill_id": "options.implied_vol",
  "data": {
    "inputs": { "S": 128.42, "K": 130, "T": 0.0822, "price": 5.18, "r": 0.045, "type": "call" },
    "implied_vol": 0.4201, "iterations": 12, "converged": true
  },
  "provenance": { "source": "computed", "freshness": { "as_of": "2025-06-27T20:00:00Z", "lag_seconds": 0 }, "cost": { "credits": 1, "tier": "free" }, "warnings": [] }
}
```

<Callout type="warn">
  If `converged` is `false`, the implied vol is an approximation. This usually means the price is below intrinsic (arbitrage violation) or the inputs are inconsistent. Check `warnings` in the envelope.
</Callout>

## Next steps

<Card title="Volatility Skills" icon="wave-square" href="/skills/volatility">
  Realized vol, IV rank, variance risk premium, and regime classification — computed from archive closes.
</Card>

<Card title="Computed Analytics Skills" icon="calculator" href="/skills/computed">
  Correlations, factor exposures, DCF, portfolio optimization, Monte Carlo, and tearsheets.
</Card>
