$npx -y skills add agiprolabs/claude-trading-skills --skill options-pricing[STUB] Options pricing models including Black-Scholes, binomial trees, Monte Carlo, implied volatility surfaces, and Greeks for crypto options
| 1 | # Options Pricing |
| 2 | |
| 3 | > **Status: STUB** — This skill provides a basic Black-Scholes implementation and an overview of planned capabilities. Full implementation is awaiting community contribution. |
| 4 | |
| 5 | Options pricing is the quantitative foundation of derivatives trading. For crypto markets, options on BTC and ETH trade actively on Deribit, Lyra, and Aevo, while Solana options are emerging on platforms like Zeta Markets and PsyOptions. Understanding pricing models, implied volatility surfaces, and Greeks is essential for hedging, volatility trading, and constructing structured products. |
| 6 | |
| 7 | This skill is informational and analytical only. It does not provide financial advice or trading recommendations. |
| 8 | |
| 9 | --- |
| 10 | |
| 11 | ## Current Capabilities |
| 12 | |
| 13 | This stub includes a working Black-Scholes calculator with Greeks computation and a basic implied volatility solver. See `scripts/black_scholes.py` for the implementation. |
| 14 | |
| 15 | ```python |
| 16 | import math |
| 17 | from scipy.stats import norm |
| 18 | |
| 19 | def black_scholes_call(S: float, K: float, T: float, r: float, sigma: float) -> float: |
| 20 | """Price a European call option using Black-Scholes. |
| 21 | |
| 22 | Args: |
| 23 | S: Current underlying price. |
| 24 | K: Strike price. |
| 25 | T: Time to expiration in years. |
| 26 | r: Risk-free rate (annualized). |
| 27 | sigma: Volatility (annualized). |
| 28 | |
| 29 | Returns: |
| 30 | Theoretical call option price. |
| 31 | """ |
| 32 | d1 = (math.log(S / K) + (r + 0.5 * sigma**2) * T) / (sigma * math.sqrt(T)) |
| 33 | d2 = d1 - sigma * math.sqrt(T) |
| 34 | return S * norm.cdf(d1) - K * math.exp(-r * T) * norm.cdf(d2) |
| 35 | ``` |
| 36 | |
| 37 | Run the demo: |
| 38 | |
| 39 | ```bash |
| 40 | python scripts/black_scholes.py --demo |
| 41 | ``` |
| 42 | |
| 43 | --- |
| 44 | |
| 45 | ## Planned Capabilities |
| 46 | |
| 47 | When fully implemented, this skill will cover: |
| 48 | |
| 49 | ### Pricing Models |
| 50 | |
| 51 | | Model | Option Style | Use Case | |
| 52 | |-------|-------------|----------| |
| 53 | | Black-Scholes | European | Vanilla calls/puts, quick Greeks | |
| 54 | | Binomial Tree | American | Early exercise, dividend-paying assets | |
| 55 | | Monte Carlo | Exotic | Path-dependent, barrier, Asian options | |
| 56 | | Black-76 | Futures | Futures options on crypto perpetuals | |
| 57 | |
| 58 | ### Greeks |
| 59 | |
| 60 | | Greek | Measures | Formula Basis | |
| 61 | |-------|----------|---------------| |
| 62 | | Delta | Price sensitivity to underlying | dC/dS | |
| 63 | | Gamma | Delta sensitivity to underlying | d²C/dS² | |
| 64 | | Theta | Time decay per day | dC/dT | |
| 65 | | Vega | Sensitivity to volatility | dC/dσ | |
| 66 | | Rho | Sensitivity to interest rates | dC/dr | |
| 67 | |
| 68 | ### Implied Volatility |
| 69 | |
| 70 | - Newton-Raphson and bisection IV solvers |
| 71 | - Volatility smile and skew analysis |
| 72 | - IV surface construction (strike x expiry) |
| 73 | - IV term structure analysis |
| 74 | - Vol-of-vol estimation |
| 75 | |
| 76 | ### Crypto Options Platforms |
| 77 | |
| 78 | | Platform | Chain | Assets | Style | |
| 79 | |----------|-------|--------|-------| |
| 80 | | Deribit | Off-chain | BTC, ETH | European | |
| 81 | | Lyra | Optimism/Arbitrum | ETH, BTC | European | |
| 82 | | Aevo | Ethereum L2 | BTC, ETH, alts | European | |
| 83 | | Zeta Markets | Solana | SOL, BTC | European | |
| 84 | | PsyOptions | Solana | SOL, various | American | |
| 85 | |
| 86 | ### Structured Products |
| 87 | |
| 88 | - Covered calls and protective puts |
| 89 | - Straddles and strangles for volatility trading |
| 90 | - Vertical spreads for directional exposure |
| 91 | - Iron condors for range-bound markets |
| 92 | - Calendar spreads for term structure trades |
| 93 | |
| 94 | --- |
| 95 | |
| 96 | ## Prerequisites |
| 97 | |
| 98 | ```bash |
| 99 | # Core (for full implementation) |
| 100 | uv pip install numpy scipy |
| 101 | |
| 102 | # Optional (for visualization) |
| 103 | uv pip install matplotlib |
| 104 | ``` |
| 105 | |
| 106 | The included `scripts/black_scholes.py` uses only the Python standard library (`math` module) and runs without any dependencies. |
| 107 | |
| 108 | --- |
| 109 | |
| 110 | ## Use Cases |
| 111 | |
| 112 | ### Hedging |
| 113 | Compute delta-neutral hedge ratios for crypto spot positions using options. Calculate the number of put contracts needed to protect a portfolio against downside moves. |
| 114 | |
| 115 | ### Volatility Trading |
| 116 | Compare implied volatility to realized volatility to identify over/underpriced options. When IV significantly exceeds realized vol, selling premium may be favorable (and vice versa). |
| 117 | |
| 118 | ### Structured Products |
| 119 | Price structured products that combine options at different strikes and expirations. Analyze payoff profiles and breakeven points before execution. |
| 120 | |
| 121 | ### Risk Assessment |
| 122 | Use Greeks to understand portfolio-level exposure to price moves (delta), acceleration (gamma), time decay (theta), and volatility changes (vega). |
| 123 | |
| 124 | --- |
| 125 | |
| 126 | ## Quick Reference: Black-Scholes Formulas |
| 127 | |
| 128 | **Call price:** |
| 129 | ``` |
| 130 | C = S * N(d1) - K * e^(-rT) * N(d2) |
| 131 | ``` |
| 132 | |
| 133 | **Put price:** |
| 134 | ``` |
| 135 | P = K * e^(-rT) * N(-d2) - S * N(-d1) |
| 136 | ``` |
| 137 | |
| 138 | **Where:** |
| 139 | ``` |
| 140 | d1 = [ln(S/K) + (r + σ²/2) * T] / (σ * √T) |
| 141 | d2 = d1 - σ * √T |
| 142 | ``` |
| 143 | |
| 144 | **Put-call parity:** |
| 145 | ``` |
| 146 | C - P = S - K * e^(-rT) |
| 147 | ``` |
| 148 | |
| 149 | --- |
| 150 | |
| 151 | ## Files |
| 152 | |
| 153 | | File | Description | |
| 154 | |------|-------------| |
| 155 | | `references/planned_features.md` | Planned features, formulas, data sources, and implementation priorities | |
| 156 | | `scripts/black_scholes.py` | Black-Scholes calculator with Greeks and implied vol solver | |
| 157 | |
| 158 | --- |
| 159 | |
| 160 | ## Contributing |
| 161 | |
| 162 | This skill is a stub awaiti |