MCPInstall

position-sizing

Trade sizing methods including fixed fractional, volatility-adjusted, Kelly criterion, and liquidity-constrained sizing

Installs
581
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/agiprolabs/claude-trading-skills --skill position-sizing
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads position-sizing automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Position Sizing

Position sizing is the single most important risk management decision in trading. Your entry signal determines direction; your position size determines survival. A mediocre strategy with proper sizing will outperform a great strategy with reckless sizing over any meaningful time horizon.

Core principle: Size determines survival, not entries. Two traders with the same signals but different sizing will have wildly different outcomes. The one who sizes conservatively survives drawdowns and compounds capital; the one who oversizes blows up.

Methods Covered

MethodBest ForKey Input
Fixed FractionalGeneral trading, most recommendedAccount risk %
Volatility-AdjustedVolatile markets, multi-assetATR or realized vol
Kelly CriterionQuantified edge with track recordWin rate + payoff ratio
Liquidity-ConstrainedLow-liquidity Solana tokensPool depth
Anti-MartingaleTrend-following strategiesRecent P&L streak

1. Fixed Fractional Sizing

The most recommended method for most traders. Risk a fixed percentage of your account on each trade.

Formula

risk_amount = account_value * risk_percentage
price_risk_per_unit = entry_price - stop_loss_price
position_size_units = risk_amount / price_risk_per_unit
position_value = position_size_units * entry_price

Risk Tiers

TierRisk Per TradeUse Case
Conservative0.5–1%New strategies, drawdown recovery
Standard1–2%Most traders, proven strategies
Aggressive3–5%High-conviction setups with strong, measured edge

Example

account = 10_000  # $10,000 or 100 SOL
risk_pct = 0.02   # 2%
entry = 1.50
stop_loss = 1.30

risk_amount = account * risk_pct          # $200
price_risk = entry - stop_loss            # $0.20
position_units = risk_amount / price_risk # 1,000 tokens
position_value = position_units * entry   # $1,500

With this sizing, if the stop loss is hit, you lose exactly 2% of your account regardless of the token's price or volatility.


2. Volatility-Adjusted Sizing

Scale position size inversely with volatility. When volatility is high, take smaller positions; when low, take larger positions. This normalizes the dollar risk across different market conditions.

Formula

adjusted_size = base_size * (target_vol / current_vol)

Where:

  • target_vol: your desired daily portfolio volatility (e.g., 2%)
  • current_vol: the token's current daily volatility (from ATR or realized vol)

Using ATR

atr_14 = 0.12          # 14-period ATR
close_price = 1.50
daily_vol_pct = atr_14 / close_price  # 8%

target_daily_vol = account * 0.02      # $200 target daily move
position_size = target_daily_vol / atr_14  # 1,667 units

This automatically reduces exposure in volatile markets and increases it in calm ones.


3. Kelly Criterion

The mathematically optimal fraction of capital to risk, maximizing long-term growth rate. Derived from maximizing expected logarithmic utility.

Formula

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

Where:

  • p = win rate (probability of winning trade)
  • q = 1 - p (probability of losing trade)
  • b = average win / average loss (payoff ratio)
  • f* = optimal fraction of capital to risk

Equivalent form: f* = (p * (b + 1) - 1) / b

Critical Rule: NEVER Use Full Kelly

Full Kelly assumes perfect knowledge of your edge. In practice, edge estimates are noisy. Always use fractional Kelly:

FractionUse CaseNotes
0.25x KellyConservative, recommended defaultRobust to edge estimation error
0.50x KellyModerate, for well-measured edgesStill significant drawdown risk
1.0x KellyNever in practiceTheoretical maximum, catastrophic if edge is overestimated

Example

win_rate = 0.55       # 55% win rate
avg_win = 2.0         # Average win is 2x the average loss
avg_loss = 1.0
payoff_ratio = avg_win / avg_loss  # b = 2.0

kelly = (win_rate * payoff_ratio - (1 - win_rate)) / payoff_ratio
# kelly = (0.55 * 2.0 - 0.45) / 2.0 = 0.325 = 32.5%

quarter_kelly = kelly * 0.25  # 8.1% — use this
half_kelly = kelly * 0.50     # 16.25%

If Kelly is negative, you have no edge. Do not trade.

See references/sizing_formulas.md for the full mathematical derivation.


4. Liquidity-Constrained Sizing

Critical for Solana tokens. Even if your risk model says you can take a large position, the pool may not support it without unacceptable slippage.

Formula (Constant-Product AMM)

slippage ≈ trade_size / pool_liquidity
max_trade = pool_liquidity * max_slippage_pct

Rules of Thumb

ConstraintGuideline
Max single trade2% of pool liquidity
Max position5% of pool liquidity
Minimum pool depth10x your desired position size

Example

pool_sol = 500          # 500 SOL in pool
max_slippage = 0.02     # 2% max slippage

max_trade_sol = pool_sol * max_slippage  # 10 SOL
# For a $150 SOL price, that's $1,500 max per trade

Always check all pools, not just the largest. Aggregate liquidity across Raydium, Orca, and Meteora for the full picture. See the liquidity-analysis skill for pool depth assessment.


5. Anti-Martingale Sizing

Increase size after wins, decrease after losses. This is the opposite of the gambler's fallacy (Martingale). The logic: winning streaks may indicate your strategy is in sync with the market; losing streaks may indicate regime change.

Implementation

def anti_martingale_size(
    base_size: float,
    consecutive_wins: int,
    consecutive_losses: int,
    scale_factor: float = 0.25,
    max_multiplier: float = 2.0,
    min_multiplier: float = 0.5,
) -> float:
    if consecutive_losses > 0:
        multiplier = max(min_multiplier, 1.0 - consecutive_losses * scale_factor)
    elif consecutive_wins > 0:
        multiplier = min(max_multiplier, 1.0 + consecutive_wins * scale_factor)
    else:
        multiplier = 1.0
    return base_size * multiplier

Use conservatively. After 3+ consecutive losses, reducing size by 50% protects capital during drawdowns.


Position Sizing Ladder

Combine all methods and take the most conservative result:

1. Calculate Kelly size          → theoretical max based on edge
2. Calculate fixed fractional    → risk-based size
3. Calculate volatility-adjusted → vol-normalized size
4. Calculate liquidity-constrained max → market-based ceiling
5. Final size = min(all four)    → binding constraint wins

The binding constraint tells you what is limiting your size:

  • Kelly-bound: your edge is small, size accordingly
  • Risk-bound: standard risk management is the limit
  • Volatility-bound: market is too volatile for larger size
  • Liquidity-bound: pool cannot absorb more without slippage

Account-Level Limits

Individual position sizing is necessary but not sufficient. You also need portfolio-level constraints:

LimitGuidelineRationale
Max single position10% of portfolioDiversification floor
Max correlated exposure25% of portfolioCorrelated assets move together
Max total exposure50–80% of portfolioCash reserve for opportunities/margin
Max positions5–10 concurrentAttention and management bandwidth

PumpFun / Meme Token Sizing

PumpFun and early-stage meme tokens require special sizing discipline:

  • Very small positions: 0.1–1 SOL per trade due to extreme risk
  • Scale with bonding curve fill %: smaller when early (high rug risk), slightly larger when proven (graduated to Raydium)
  • Never size based on expected return — size based on acceptable total loss
  • Treat as lottery tickets: expect most to go to zero
  • Position limit: no more than 5–10% of portfolio across all meme positions combined
# PumpFun sizing example
account_sol = 100
meme_budget = account_sol * 0.05   # 5 SOL total for memes
per_trade = meme_budget / 10       # 0.5 SOL each, 10 shots

Integration with Other Skills

SkillIntegration
risk-managementPortfolio-level limits, drawdown rules
liquidity-analysisPool depth data for liquidity constraints
kelly-criterionDeeper Kelly math, edge estimation
exit-strategiesStop loss placement affects fixed fractional sizing
volatility-modelingBetter vol estimates for volatility-adjusted sizing
slippage-modelingPrecise slippage estimates for liquidity constraints

Files

References

  • references/sizing_formulas.md — Mathematical derivations for all sizing methods with worked examples
  • references/practical_guide.md — Sizing by account size, token type, and common mistakes

Scripts

  • scripts/size_calculator.py — Calculates position size using all methods, shows binding constraint
  • scripts/portfolio_sizer.py — Portfolio risk dashboard with per-position risk and available budget

Quick Reference

# Minimal fixed fractional sizing — copy-paste starter
def calc_position_size(
    account: float, risk_pct: float, entry: float, stop: float
) -> float:
    """Return number of units to buy."""
    risk_amount = account * risk_pct
    price_risk = abs(entry - stop)
    if price_risk == 0:
        return 0.0
    return risk_amount / price_risk

FAQ

What does the position-sizing skill do?

Trade sizing methods including fixed fractional, volatility-adjusted, Kelly criterion, and liquidity-constrained sizing

How do I install position-sizing?

Run npx skills add https://github.com/agiprolabs/claude-trading-skills --skill position-sizing in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/position-sizing/ (personal) or .claude/skills/position-sizing/ (project).

Which AI agents can use position-sizing?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is position-sizing safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains position-sizing?

It is published by agiprolabs in agiprolabs/claude-trading-skills. It has 581 recorded installs.

More from agiprolabs/claude-trading-skills

View all →

walk-forward-validation

agiprolabs/claude-trading-skills

Walk-forward validation framework for trading strategies and ML models with time-series-aware splits, overfit detection, and regime-aware validation

Business & Finance714 installs

risk-management

agiprolabs/claude-trading-skills

Portfolio-level risk controls, drawdown management, exposure limits, and circuit breakers for crypto trading

Business & Finance637 installs

pandas-ta

agiprolabs/claude-trading-skills

Technical analysis with 130+ indicators using pandas-ta for crypto market data

Data & Databases593 installs

regime-detection

agiprolabs/claude-trading-skills

Market regime identification using volatility clustering, trend detection, and statistical methods for adaptive trading

Business & Finance578 installs

kelly-criterion

agiprolabs/claude-trading-skills

Kelly criterion optimal sizing with fractional variants, edge estimation, and practical application for crypto trading

Business & Finance534 installs

trade-journal

agiprolabs/claude-trading-skills

Structured trade logging, performance review, behavioral pattern detection, and strategy attribution for systematic improvement

Popular business & finance skills

View category →

sales-enablement

coreyhaines31/marketingskills

When the user wants to create sales collateral, pitch decks, one-pagers, objection handling docs, or demo scripts. Also use when the user mentions 'sales deck,' 'pitch deck,' 'one-pager,' 'leave-behind,' 'objection handling,' 'deal-specific ROI analysis,' 'demo script,' 'talk track,' 'sales playbook,' 'proposal template,' 'buyer persona card,' 'battle card,' 'battlecard,' 'competitive one-pager,' 'win-loss analysis,' 'why are we losing deals,' 'loss reasons,' 'how do I respond to this objection,' 'prospect just said,' 'help my sales team,' 'sales materials,' or 'what should I give my sales reps,' 'cold call script,' or 'voicemail script.' Use this for any document or asset that helps a sales team close deals. For public competitor comparison pages, see competitors. For running buyer interviews or churn research, see customer-research. For marketing website copy, see copywriting. For cold outreach emails, see cold-email. For the offer being sold (bonuses, guarantees, pricing structure),

Business & Finance119.5K installs

revops

coreyhaines31/marketingskills

When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes. Also use when the user mentions 'RevOps,' 'revenue operations,' 'lead scoring,' 'outbound pipeline stages,' 'lead routing,' 'MQL,' 'SQL,' 'pipeline stages,' 'deal desk,' 'CRM automation,' 'marketing-to-sales handoff,' 'data hygiene,' 'leads aren't getting to sales,' 'pipeline management,' 'lead qualification,' or 'when should marketing hand off to sales.' Use this for anything involving the systems and processes that connect marketing to revenue. For cold outreach emails, see cold-email. For email drip campaigns, see emails. For pricing decisions, see pricing.

Business & Finance114.1K installs

sales-funnel-blueprint

autonnel/autonnel-skills

Turn an offer into a concrete multi-step sales funnel spec - page-by-page structure, price ladder, copy outline and the metrics each step must hit. Use when asked to build a sales funnel, marketing funnel, landing page flow, lead magnet funnel, webinar funnel, tripwire or VSL funnel, when planning a product launch page flow, or when someone asks "what pages do I need" for selling something online.

Business & Finance104.5K installs

pricing

coreyhaines31/marketingskills

When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' 'should I offer a free plan,' 'pricing page teardown,' 'pricing page audit,' 'is my pricing page AI-readable,' or 'can AI read my pricing.' Use this whenever someone is figuring out what to charge, how to structure their plans, or wants to audit a pricing page (for humans and for the AI agents that shortlist tools). For in-app upgrade screens, see paywalls. For offer construction (bonuses, guarantees, value framing, naming) on services/courses/coaching/high-ticket B2B, see offers.

Business & Finance80K installs

cross-border-ecommerce

nexscope-ai/ecommerce-skills

Cross-border e-commerce expansion advisor. Scores target markets on 8 weighted dimensions (market size, ecommerce penetration, competition, regulatory complexity, logistics infrastructure, payment ecosystem, cultural distance, IP protection), compares 5 fulfillment models with cost and transit data, provides country-by-country tax/duty compliance guides (EU VAT/IOSS, UK VAT, US sales tax, CA GST, AU GST, JP consumption tax), maps local payment preferences by market, and builds a phased expansion roadmap. No API key required.

Business & Finance62.9K installs

pricing-strategy

coreyhaines31/marketingskills

When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' or 'should I offer a free plan.' Use this whenever someone is figuring out what to charge or how to structure their plans. For in-app upgrade screens, see paywall-upgrade-cro.

Business & Finance61.2K installs