Handles position sizing calculations from Kelly criterion to risk budgeting. You'll reach for this when deciding how much capital to put in a single position, whether you're sizing a concentrated portfolio or allocating a VaR budget across trades. It covers both discrete bets (binary outcomes with known odds) and continuous investments (normal distributions), plus practical adjustments like fractional Kelly since full Kelly tends to be way too aggressive in practice. The formulas are here for volatility scaling, conviction weighting, and liquidity-based limits. Honestly most useful for the worked examples that show why half Kelly achieves 75% of the growth with dramatically lower drawdowns, which is the kind of practical insight that actually changes how you size positions.

skills.sh installs
755
GitHub stars
224
last updated
Aug 21, 2026

Install

$ npx -y skills add joellewis/finance_skills --skill bet-sizing --agent claude-code

Installs into .claude/skills of the current project.

Files

Bet Sizing

Core Concepts

Kelly Criterion (Discrete)

For a binary bet with payoff odds b, win probability p, and loss probability q = 1-p:

f* = (b*p - q) / b

where f* is the optimal fraction of wealth to wager. The Kelly criterion maximizes the expected logarithm of wealth (geometric growth rate) over repeated bets.

Properties:

  • f* = 0 when edge = 0 (no bet when there is no advantage)
  • f* < 0 when negative edge (the formula tells you to bet the other side)
  • f* > 0 only when b*p > q (positive expected value)

Note: the reference script's discrete_kelly clamps negative Kelly fractions to 0 (no bet) rather than returning a negative value — it does not recommend taking the other side.

Kelly Criterion (Continuous / Investment)

For a normally distributed investment return with expected excess return mu-r_f and variance sigma^2:

f* = (mu - r_f) / sigma^2

This gives the fraction of total wealth to allocate. For example, an asset with 8% expected excess return and 20% volatility: f* = 0.08 / 0.04 = 2.0 (200% of wealth — implying leverage).

Sponsors

Details

Repository
github.com/joellewis/finance_skills
Category
Finance & Trading
First seen
Jun 3, 2026

More from joellewis/finance_skills

All 84
1joellewis avatartime-value-of-moneyjoellewis/finance_skillsCalculate present value, future value, NPV, IRR for projects and loans, loan payments, and amortization schedules across all compounding conventions. Use when t754skills.sh installs
2ruvnet avatartrader-backtestruvnet/rufloRun a historical backtest using npx neural-trader with Rust/NAPI engine (8-19x faster) and walk-forward validation; Ed25519-sign the result for paper→live tampe746skills.sh installs
3whawkinsiv avataraccountingwhawkinsiv/claude-code-skillsaccounting742skills.sh installs
4joellewis avatarsavings-goalsjoellewis/finance_skillsPlan and track savings for specific financial goals including retirement, education, and home purchase. Use when the user asks about required savings rates, 529741skills.sh installs
5chengzuopeng avatarstock-analystchengzuopeng/stock-sdk-mcp股票技术分析专家 - 提供专业的 K 线形态、技术指标、资金流向与北向持仓分析735skills.sh installs
6joellewis avatardigital-assetsjoellewis/finance_skillsAnalyze digital assets including cryptocurrency fundamentals, blockchain mechanics, DeFi protocols, and on-chain metrics. Use when the user asks about crypto in719skills.sh installs