# Black Scholes

> A Claude skill from brainbytes-dev/everything-claude-trading.

- **Type:** Skill
- **Install:** `agentstack add skill-brainbytes-dev-everything-claude-trading-black-scholes`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [brainbytes-dev](https://agentstack.voostack.com/s/brainbytes-dev)
- **Installs:** 0
- **Category:** [Finance & Payments](https://agentstack.voostack.com/c/finance-and-payments)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [brainbytes-dev](https://github.com/brainbytes-dev)
- **Source:** https://github.com/brainbytes-dev/everything-claude-trading/tree/main/skills/derivatives/black-scholes

## Install

```sh
agentstack add skill-brainbytes-dev-everything-claude-trading-black-scholes
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Black-Scholes-Merton Model and Extensions

> BSM derivation intuition, formula, put-call parity, Greeks, limitations, and extensions for dividends, American options, and implied volatility.

## When to Activate

- User pricing European options or computing implied volatility
- Deriving or interpreting BSM Greeks for hedging
- Understanding BSM assumptions and when they break down
- Extending BSM for dividends, discrete hedging, or jumps
- Computing put-call parity relationships or identifying arbitrage
- Teaching or explaining option pricing fundamentals

## Core Concepts

### BSM Derivation Intuition

The Black-Scholes-Merton model rests on three pillars:

1. **Geometric Brownian Motion (GBM)**: stock price follows dS = mu*S*dt + sigma*S*dW
   - Log returns are normally distributed: ln(S_T/S_0) ~ N((mu - sigma^2/2)*T, sigma^2*T)
   - Continuous paths, no jumps — a key limitation

2. **No-arbitrage / risk-neutral pricing**: construct a riskless portfolio of option + delta shares
   - The portfolio earns the risk-free rate by no-arbitrage
   - Under the risk-neutral measure, the drift of S becomes r (risk-free rate), not mu
   - Option price = discounted expected payoff under risk-neutral measure

3. **Continuous hedging**: delta hedge is rebalanced continuously (no transaction costs)
   - In practice, discrete hedging introduces hedging error proportional to gamma * (dS)^2

### BSM Formula

**European Call**:
C = S * N(d1) - K * exp(-rT) * N(d2)

**European Put**:
P = K * exp(-rT) * N(-d2) - S * N(-d1)

Where:
- d1 = [ln(S/K) + (r + sigma^2/2)*T] / (sigma * sqrt(T))
- d2 = d1 - sigma * sqrt(T)
- N(x) = cumulative standard normal distribution
- S = spot price, K = strike, r = risk-free rate, T = time to expiry, sigma = volatility

**Interpretation**:
- N(d2) = risk-neutral probability that the option expires in-the-money
- S * N(d1) = present value of receiving the stock conditional on exercise
- K * exp(-rT) * N(d2) = present value of paying the strike conditional on exercise
- Delta of call = N(d1); Delta of put = N(d1) - 1

### Put-Call Parity

For European options with same strike and expiry:
- C - P = S - K * exp(-rT)
- Holds by no-arbitrage regardless of model
- If violated, construct an arbitrage: buy the cheap side, sell the expensive side
- With dividends: C - P = S - PV(dividends) - K * exp(-rT)
- Put-call parity does NOT hold for American options (early exercise creates inequality)

### BSM Greeks (Analytical)

**Delta**: dC/dS = N(d1) for calls; N(d1) - 1 for puts
**Gamma**: d^2C/dS^2 = phi(d1) / (S * sigma * sqrt(T)) — same for calls and puts
**Theta**: dC/dt = -(S * phi(d1) * sigma) / (2*sqrt(T)) - r * K * exp(-rT) * N(d2) for calls
**Vega**: dC/d(sigma) = S * phi(d1) * sqrt(T) — same for calls and puts
**Rho**: dC/dr = K * T * exp(-rT) * N(d2) for calls

Where phi(x) = standard normal density function.

### BSM Assumptions and Limitations

1. **Constant volatility**: real markets show volatility smile/skew — OTM puts have higher implied vol
2. **Log-normal returns**: real returns have fat tails and negative skewness
3. **No jumps**: real prices jump (earnings, macro events) — jump-diffusion models address this
4. **Continuous trading**: discrete hedging introduces P&L noise
5. **No transaction costs**: in practice, hedging costs make BSM prices underestimates
6. **Constant interest rates**: relevant for long-dated options on bonds/rates
7. **No dividends**: base BSM assumes no dividends (correctable)
8. **European exercise**: BSM does not price American options directly

## Methodology

### Implied Volatility Computation

Implied volatility is the sigma that makes BSM price equal to the observed market price.

**Newton-Raphson Method**:
1. Start with initial guess sigma_0 (e.g., 20%)
2. Compute BSM price C(sigma_n) and vega V(sigma_n)
3. Update: sigma_{n+1} = sigma_n - (C(sigma_n) - C_market) / V(sigma_n)
4. Converge when |C(sigma_n) - C_market|  implied vol.
```

## Quality Gate

- BSM should only be used as a benchmark; always acknowledge smile/skew effects for real pricing
- Implied volatility must converge within 0.01% accuracy; verify with independent pricer
- Put-call parity must hold to within bid-ask spread; violations indicate data errors or arbitrage
- Greeks must be computed analytically from BSM for European options (not finite differences unless validating)
- For American options, do not use BSM — use binomial trees or finite difference methods
- Dividend treatment must match the actual dividend schedule (discrete dividends for single stocks, continuous yield for indices)
- When BSM implied vol varies significantly across strikes (>5 vol points), note that BSM is failing and a stochastic vol or local vol model is needed
- Validate BSM implementation against known test cases (e.g., ATM call approximately = S * sigma * sqrt(T) * 0.4)
- Document all input assumptions (rate curve, dividend yield, borrow cost) used in BSM calculation

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [brainbytes-dev](https://github.com/brainbytes-dev)
- **Source:** [brainbytes-dev/everything-claude-trading](https://github.com/brainbytes-dev/everything-claude-trading)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-brainbytes-dev-everything-claude-trading-black-scholes
- Seller: https://agentstack.voostack.com/s/brainbytes-dev
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
