Agent skill

options-payoff

Generate an interactive options payoff curve chart with dynamic parameter controls. Use this skill whenever the user shares an options position screenshot, describes an options strategy, or asks to visualize how an options trade makes or loses money. Triggers include: any mention of butterfly, spread (vertical/calendar/diagonal/ratio), straddle, strangle, condor, covered call, protective put, iron condor, or any multi-leg options structure. Also triggers when a user pastes strike prices, premiums, expiry dates, or says things like "show me the payoff", "draw the P&L curve", "what does this trade look like", or uploads a screenshot from a broker (IBKR, TastyTrade, Robinhood, etc). Always use this skill even if the user only provides partial info — extract what you can and use defaults for the rest.

Stars 1,035
Forks 101

Install this agent skill to your Project

npx add-skill https://github.com/himself65/finance-skills/tree/main/plugins/market-analysis/skills/options-payoff

SKILL.md

Options Payoff Curve Skill

Generates a fully interactive HTML widget (via visualize:show_widget) showing:

  • Expiry payoff curve (dashed gray line) — intrinsic value at expiration
  • Theoretical value curve (solid colored line) — Black-Scholes price at current DTE/IV
  • Dynamic sliders for all key parameters
  • Real-time stats: max profit, max loss, breakevens, current P&L at spot

Step 1: Extract Strategy From User Input

When the user provides a screenshot or text, extract:

Field Where to find it Default if missing
Strategy type Title bar / leg description "custom"
Underlying Ticker symbol SPX
Strike(s) K1, K2, K3... in title or leg table nearest round number
Premium paid/received Filled price or avg price 5.00
Quantity Position size 1
Multiplier 100 for equity options, 100 for SPX 100
Expiry Date in title 30 DTE
Spot price Current underlying price (NOT strike) middle strike
IV Shown in greeks panel, or estimate from vega 20%
Risk-free rate 4.3%

Critical for screenshots: The spot price is the CURRENT price of the underlying index/stock, NOT the strikes. Never default spot to a strike price value.

Current SPX reference price:

!`python3 -c "import yfinance as yf; print(f'SPX ≈ {yf.Ticker(\"^GSPC\").fast_info[\"lastPrice\"]:.0f}')" 2>/dev/null || echo "SPX price unavailable — check market data"`

Step 2: Identify Strategy Type

Match to one of the supported strategies below, then read the corresponding section in references/strategies.md.

Strategy Legs Key Identifiers
butterfly Buy K1, Sell 2×K2, Buy K3 3 strikes, "Butterfly" in title
vertical_spread Buy K1, Sell K2 (same expiry) 2 strikes, debit or credit
calendar_spread Buy far-expiry K, Sell near-expiry K Same strike, 2 expiries
iron_condor Sell K2/K3, Buy K1/K4 wings 4 strikes, 2 spreads
straddle Buy Call K + Buy Put K Same strike, both types
strangle Buy OTM Call + Buy OTM Put 2 strikes, both OTM
covered_call Long 100 shares + Sell Call K Stock + short call
naked_put Sell Put K Single leg
ratio_spread Buy 1×K1, Sell N×K2 Unequal quantities

For strategies not listed, use custom mode: decompose into individual legs and sum their P&Ls.


Step 3: Compute Payoffs

Black-Scholes Put Price

d1 = (ln(S/K) + (r + σ²/2)·T) / (σ·√T)
d2 = d1 - σ·√T
put = K·e^(-rT)·N(-d2) - S·N(-d1)

Black-Scholes Call Price (via put-call parity)

call = put + S - K·e^(-rT)

Butterfly Put Payoff (expiry)

if S >= K3: 0
if S >= K2: K3 - S
if S >= K1: S - K1
else: 0

Net P&L per share = payoff − premium_paid

Vertical Spread (call debit) Payoff (expiry)

long_call = max(S - K1, 0)
short_call = max(S - K2, 0)
payoff = long_call - short_call - net_debit

Calendar Spread Theoretical Value

Calendar cannot be expressed as a simple expiry function — always use BS pricing for both legs:

value = BS(S, K, T_far, r, IV_far) - BS(S, K, T_near, r, IV_near)

For expiry curve of calendar: near leg expires worthless, far leg = BS with remaining T.

Iron Condor Payoff (expiry)

put_spread = max(K2-S, 0) - max(K1-S, 0)   // short put spread
call_spread = max(S-K3, 0) - max(S-K4, 0)  // short call spread
payoff = credit_received - put_spread - call_spread

Step 4: Render the Widget

Use visualize:read_me with modules ["chart", "interactive"] before building.

Required Controls (sliders)

Structure section:

  • All strike prices (K1, K2, K3... as needed by strategy)
  • Premium paid/received
  • Quantity
  • Multiplier (100 default, show for clarity)

Pricing variables section:

  • IV % (5–80%, step 0.5)
  • DTE — days to expiry (0–90)
  • Risk-free rate % (0–8%)

Spot price:

  • Full-width slider, range = [min_strike - 20%, max_strike + 20%], defaulting to ACTUAL current spot

Required Stats Cards (live-updating)

  • Max profit (expiry)
  • Max loss (expiry)
  • Breakeven(s) — show both for two-sided strategies
  • Current theoretical P&L at spot

Chart Specs

  • X-axis: SPX/underlying price
  • Y-axis: Total USD P&L (not per-share)
  • Blue solid line = theoretical value at current DTE/IV
  • Gray dashed line = expiry payoff
  • Green dashed vertical = strike prices (K2 center strike brighter)
  • Amber dashed vertical = current spot price
  • Fill above zero = green 10% opacity; below zero = red 10% opacity
  • Tooltip: show both curves on hover

Code template

Use this JS structure inside the widget, adapting pnlExpiry() and bfTheory() per strategy:

js
// Black-Scholes helpers (always include)
function normCDF(x) { /* Horner approximation */ }
function bsCall(S,K,T,r,sig) { /* standard BS call */ }
function bsPut(S,K,T,r,sig) { /* standard BS put */ }

// Strategy-specific expiry payoff (returns per-share value BEFORE premium)
function expiryValue(S, ...strikes) { ... }

// Strategy-specific theoretical value using BS
function theoreticalValue(S, ...strikes, T, r, iv) { ... }

// Main update() reads all sliders, computes arrays, destroys+recreates Chart.js instance
function update() { ... }

// Attach listeners
['k1','k2',...,'iv','dte','rate','spot'].forEach(id => {
  document.getElementById(id).addEventListener('input', update);
});
update();

Step 5: Respond to User

After rendering the widget, briefly explain:

  1. What strategy was detected and how legs were mapped
  2. Max profit / max loss at current settings
  3. One key insight (e.g., "spot is currently 950 pts below the profit zone, expiring tomorrow")

Keep it concise — the chart speaks for itself.


Reference Files

  • references/strategies.md — Detailed payoff formulas and edge cases for each strategy type
  • references/bs_code.md — Copy-paste ready Black-Scholes JS implementation with normCDF

Read the relevant reference file if you're unsure about payoff formula edge cases for a given strategy.

Expand your agent's capabilities with these related and highly-rated skills.

himself65/finance-skills

finance-sentiment

Fetch structured stock sentiment across Reddit, X.com, news, and Polymarket using the Adanos Finance API. Use this skill whenever the user asks how much people are talking about a stock, how hot a ticker is on social platforms, how many Polymarket bets exist for a company, whether sources are aligned, or to compare stock sentiment across multiple tickers. Triggers include: "social sentiment on TSLA", "how hot is NVDA on X.com", "how many Reddit mentions does AAPL have", "compare sentiment on AMD vs NVDA", "how many Polymarket bets on Microsoft", "is Reddit aligned with X on META", "stock buzz", "bullish percentage", and any mention of cross-source stock sentiment research. This skill is READ-ONLY and does not place trades or modify anything.

1,035 101
Explore
himself65/finance-skills

hormuz-strait

Check the current status of the Strait of Hormuz — shipping transit data, oil price impact, stranded vessels, insurance risk levels, diplomatic developments, and global trade impact. Use this skill whenever the user asks about the Strait of Hormuz, Hormuz chokepoint, Persian Gulf shipping risk, oil transit disruption, war risk premium in the Gulf, Middle East shipping routes, tanker traffic through Hormuz, oil supply chain risk, or geopolitical risk affecting energy markets. Triggers include: "Hormuz status", "Strait of Hormuz", "is Hormuz open", "shipping through the Gulf", "oil chokepoint", "Persian Gulf tanker traffic", "war risk premium", "Hormuz crisis", "energy supply chain risk", "oil transit disruption", "Middle East shipping", any mention of Hormuz or Persian Gulf in context of oil, shipping, or geopolitical risk.

1,035 101
Explore
himself65/finance-skills

funda-data

Fetch financial data from the Funda AI API (https://api.funda.ai). Covers quotes, historical prices, financials, SEC filings, earnings transcripts, analyst estimates, options flow/greeks/GEX, supply chain graph, social sentiment, prediction markets, congressional trades, economic indicators, ESG, and news. Triggers: stock quotes, fundamentals, balance sheet, income statement, cash flow, analyst targets, DCF, options chain/flow/unusual activity, GEX, IV rank, max pain, earnings/dividend/IPO calendar, SEC filings (10-K/10-Q/8-K), transcripts, supply chain (suppliers/customers/competitors), congressional trading, insider trades, institutional holdings (13F), Reddit/Twitter sentiment, Polymarket, treasury rates, GDP, CPI, FRED data, ESG scores, commodity/forex/crypto prices, stock screener, sector performance, ETF holdings, news, COT reports. Also triggers for "funda" or "funda.ai". If only a ticker is provided and Funda API can answer, use this skill.

1,035 101
Explore
himself65/finance-skills

etf-premium

Calculate ETF premium or discount relative to Net Asset Value (NAV) using Yahoo Finance data. Use this skill whenever the user asks about an ETF's premium or discount, NAV comparison, whether an ETF is trading above or below its fair value, or wants to compare market price vs NAV. Triggers: "ETF premium", "ETF discount", "NAV premium", "is SPY trading at a premium", "AGG premium to NAV", "market price vs NAV", "ETF mispricing", "BITO premium", "IBIT premium", "bond ETF discount", "trading above/below NAV", "ETF premium screener", "which ETFs have biggest discount", "compare ETF NAV", "ETF arbitrage", or any request involving the gap between an ETF's market price and its underlying value. Also triggers when analyzing leveraged, inverse, international, bond, commodity, or crypto ETFs where premium/discount is a known concern.

1,035 101
Explore
himself65/finance-skills

saas-valuation-compression

Analyze SaaS company valuation compression between funding rounds. Use this skill whenever the user asks about: how much a SaaS company's valuation multiple changed between rounds, why the ARR multiple compressed or expanded, comparing a company's compression to macro benchmarks, or explaining what drove valuation changes for any VC-backed software company. Trigger on phrases like "valuation compression", "ARR multiple", "round-to-round valuation", "multiple change", or when the user asks to compare a company's funding rounds. Always use this skill for any multi-round SaaS valuation analysis — do not try to answer from memory alone.

1,035 101
Explore
himself65/finance-skills

sepa-strategy

Analyze stocks using Mark Minervini's SEPA (Specific Entry Point Analysis) methodology. Use this skill whenever the user mentions SEPA, Minervini, superperformance, trend template, VCP (Volatility Contraction Pattern), Stage 2 uptrend, stage analysis, pivot point breakout, or asks about growth stock screening criteria. Also triggers when the user wants to evaluate whether a stock meets swing trading entry criteria, check moving average alignment (bullish stacking: price above 50MA above 150MA above 200MA), assess breakout quality with volume confirmation, calculate position sizing based on risk percentage, or identify consolidation patterns like cup-with-handle, flat base, bull flag, or high tight flag. Use this skill even when the user simply asks "should I buy this stock" or "is this a good setup" in the context of growth/momentum trading, or when they share a stock chart and want pattern analysis.

1,035 101
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results