Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Quantitative methods for financial modeling, derivatives pricing, and risk an...
.claude/skills/brycewang-stanford-quantitative-finance-guide/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | 78% | 0% |
| case-04 | ✓→✗ | ▼ Worse | 14% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 14% | 0% |
| case-07 | ✓→✓ | = Same ✓ | 172% | 0% |
| case-08 | ✓→✓ | = Same ✓ | 69% | 0% |
A rigorous skill for applying quantitative methods to financial research, covering derivatives pricing, portfolio optimization, risk modeling, and time series econometrics. Designed for academic researchers and quantitative analysts.
The foundational model for European option pricing:
pythonimport numpy as np from scipy.stats import norm def black_scholes(S: float, K: float, T: float, r: float, sigma: float, option_type: str = 'call') -> dict: """ Black-Scholes European option pricing. Args: S: Current stock price K: Strike price T: Time to maturity (years) r: Risk-free rate (annualized) sigma: Volatility (annualized) option_type: 'call' or 'put' """ d1 = (np.log(S / K) + (r + 0.5 * sigma**2) * T) / (sigma * np.sqrt(T)) d2 = d1 - sigma * np.sqrt(T) if option_type == 'call': price = S * norm.cdf(d1) - K * np.exp(-r * T) * norm.cdf(d2) else: price = K * np.exp(-r * T) * norm.cdf(-d2) - S * norm.cdf(-d1) greeks = { 'delta': norm.cdf(d1) if option_type == 'call' else norm.cdf(d1) - 1, 'gamma': norm.pdf(d1) / (S * sigma * np.sqrt(T)), 'theta': -(S * norm.pdf(d1) * sigma) / (2 * np.sqrt(T)), 'vega': S * norm.pdf(d1) * np.sqrt(T), 'rho': K * T * np.exp(-r * T) * norm.cdf(d2) if option_type == 'call' else -K * T * np.exp(-r * T) * norm.cdf(-d2) } return {'price': price, 'greeks': greeks} # Example: price a call option result = black_scholes(S=100, K=105, T=0.5, r=0.05, sigma=0.20, option_type='call') print(f"Call Price: ${result['price']:.2f}") print(f"Delta: {result['greeks']['delta']:.4f}")
For path-dependent options and complex payoffs:
pythondef monte_carlo_option(S0, K, T, r, sigma, n_paths=100000, n_steps=252): """Geometric Brownian Motion Monte Carlo pricer.""" dt = T / n_steps Z = np.random.standard_normal((n_paths, n_steps)) paths = np.zeros((n_paths, n_steps + 1)) paths[:, 0] = S0 for t in range(n_steps): paths[:, t + 1] = paths[:, t] * np.exp( (r - 0.5 * sigma**2) * dt + sigma * np.sqrt(dt) * Z[:, t] ) payoffs = np.maximum(paths[:, -1] - K, 0) price = np.exp(-r * T) * np.mean(payoffs) std_err = np.exp(-r * T) * np.std(payoffs) / np.sqrt(n_paths) return {'price': price, 'std_error': std_err, '95_ci': (price - 1.96*std_err, price + 1.96*std_err)}
Construct efficient frontiers using quadratic programming:
pythonfrom scipy.optimize import minimize def efficient_frontier(returns: np.ndarray, n_portfolios: int = 50) -> list: """ Compute efficient frontier points. returns: T x N array of asset returns """ n_assets = returns.shape[1] mean_returns = returns.mean(axis=0) cov_matrix = np.cov(returns.T) results = [] target_returns = np.linspace(mean_returns.min(), mean_returns.max(), n_portfolios) for target in target_returns: constraints = [ {'type': 'eq', 'fun': lambda w: np.sum(w) - 1}, {'type': 'eq', 'fun': lambda w, t=target: w @ mean_returns - t} ] bounds = [(0, 1)] * n_assets w0 = np.ones(n_assets) / n_assets result = minimize(lambda w: w @ cov_matrix @ w, w0, bounds=bounds, constraints=constraints, method='SLSQP') if result.success: vol = np.sqrt(result.fun) results.append({'return': target, 'volatility': vol, 'weights': result.x}) return results
Three approaches to VaR estimation:
pythondef compute_var_es(returns: np.ndarray, confidence: float = 0.95) -> dict: """Compute VaR and Expected Shortfall (CVaR).""" sorted_returns = np.sort(returns) var_index = int((1 - confidence) * len(sorted_returns)) var = -sorted_returns[var_index] es = -sorted_returns[:var_index].mean() return {'VaR': var, 'ES': es, 'confidence': confidence}
For financial time series, test for stationarity (ADF test), model volatility clustering with GARCH models, and check for cointegration in pairs trading strategies. Always report Newey-West standard errors when autocorrelation is present, and use information criteria (AIC, BIC) for model selection.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-09 | fail→fail | 18,232 | 12,223 | -33% | 1 | 1 | 0% | 3,061 | 3,700 | +21% | 0 | 0 | — |
case-01 | fail→fail | 20,186 | 26,338 | +30% | 1 | 1 | 0% | 4,302 | 6,459 | +50% | 0 | 0 | — |
case-02 | fail→fail | 19,636 | 24,735 | +26% | 1 | 1 | 0% | 3,913 | 6,765 | +73% | 0 | 0 | — |
case-03 | fail→fail | 28,266 | 24,406 | -14% | 1 | 1 | 0% | 4,067 | 6,115 | +50% | 0 | 0 | — |
case-04 | pass→fail | 23,331 | 18,326 | -21% | 1 | 1 | 0% | 5,272 | 6,000 | +14% | 0 | 0 | — |
case-05 | pass→pass | 21,549 | 22,396 | +4% | 1 | 1 | 0% | 4,863 | 5,521 | +14% | 0 | 0 | — |
case-06 | fail→fail | 19,747 | 19,009 | -4% | 1 | 1 | 0% | 4,098 | 5,376 | +31% | 0 | 0 | — |
case-07 | pass→pass | 8,920 | 14,400 | +61% | 1 | 1 | 0% | 1,618 | 4,401 | +172% | 0 | 0 | — |
case-08 | pass→pass | 18,382 | 20,293 | +10% | 1 | 1 | 0% | 3,274 | 5,517 | +69% | 0 | 0 | — |
case-10 | fail→fail | 23,435 | 21,786 | -7% | 1 | 1 | 0% | 4,226 | 5,466 | +29% | 0 | 0 | — |
case-11 | fail→pass | 17,491 | 21,908 | +25% | 1 | 1 | 0% | 2,963 | 5,281 | +78% | 0 | 0 | — |
case-12 | pass→pass | 21,329 | 24,364 | +14% | 1 | 1 | 0% | 3,065 | 5,351 | +75% | 0 | 0 | — |
case-13 | pass→pass | 18,803 | 29,820 | +59% | 1 | 1 | 0% | 3,177 | 6,687 | +110% | 0 | 0 | — |
case-14 | pass→pass | 28,445 | 28,949 | +2% | 1 | 1 | 0% | 4,663 | 6,630 | +42% | 0 | 0 | — |
case-15 | pass→pass | 6,406 | 6,002 | -6% | 1 | 1 | 0% | 1,267 | 2,750 | +117% | 0 | 0 | — |
case-16 | pass→pass | 12,684 | 9,008 | -29% | 1 | 1 | 0% | 2,244 | 3,303 | +47% | 0 | 0 | — |
case-17 | pass→pass | 10,385 | 8,722 | -16% | 1 | 1 | 0% | 2,058 | 3,455 | +68% | 0 | 0 | — |
case-18 | pass→pass | 9,613 | 6,194 | -36% | 1 | 1 | 0% | 1,623 | 2,722 | +68% | 0 | 0 | — |
case-19 | pass→pass | 7,790 | 7,052 | -9% | 1 | 1 | 0% | 1,419 | 2,808 | +98% | 0 | 0 | — |
case-20 | fail→fail | 41,126 | 38,410 | -7% | 1 | 1 | 0% | 8,022 | 8,931 | +11% | 0 | 0 | — |
case-21 | fail→fail | 41,504 | 40,720 | -2% | 1 | 1 | 0% | 8,245 | 9,836 | +19% | 0 | 0 | — |
case-22 | fail→fail | 29,563 | 36,667 | +24% | 1 | 1 | 0% | 6,139 | 9,394 | +53% | 0 | 0 | — |
case-23 | pass→pass | 12,278 | 9,692 | -21% | 1 | 1 | 0% | 2,023 | 3,154 | +56% | 0 | 0 | — |
case-24 | pass→pass | 16,218 | 11,088 | -32% | 1 | 1 | 0% | 2,993 | 3,687 | +23% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of 0 percentage points is the difference between those two pass rates over the 24 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.