$npx -y skills add agiprolabs/claude-trading-skills --skill risk-managementPortfolio-level risk controls, drawdown management, exposure limits, and circuit breakers for crypto trading
| 1 | # Risk Management |
| 2 | |
| 3 | Portfolio-level risk controls for crypto and Solana trading. This skill provides frameworks for drawdown management, exposure limits, circuit breakers, and crypto-specific risk considerations. |
| 4 | |
| 5 | ## Risk Management Hierarchy |
| 6 | |
| 7 | Every decision must respect this priority order: |
| 8 | |
| 9 | 1. **Survival** — Never risk account ruin. No single trade, day, or week should threaten your ability to continue trading. |
| 10 | 2. **Capital preservation** — Protect what you have. Losses compound geometrically; recovery requires outsized gains. |
| 11 | 3. **Growth** — Only after survival and preservation are secured, pursue returns. |
| 12 | |
| 13 | Violating this hierarchy (chasing growth at the expense of survival) is the primary cause of account blowups. |
| 14 | |
| 15 | ## Portfolio-Level Controls |
| 16 | |
| 17 | ### 1. Maximum Drawdown Limits |
| 18 | |
| 19 | Halt trading when portfolio drawdown from equity peak reaches a threshold: |
| 20 | |
| 21 | | Account Type | Max Drawdown | Action | |
| 22 | |---|---|---| |
| 23 | | Conservative | -15% | Full stop, review all strategies | |
| 24 | | Moderate | -20% | Full stop, reduce to minimum size on recovery | |
| 25 | | Aggressive | -25% | Full stop, mandatory cooling period | |
| 26 | |
| 27 | Recovery math makes this critical: a -20% drawdown requires +25% to recover. A -50% drawdown requires +100%. See `references/drawdown_management.md` for the full recovery table. |
| 28 | |
| 29 | ### 2. Daily Loss Limits |
| 30 | |
| 31 | Stop opening new positions after daily P&L (realized + unrealized) hits: |
| 32 | |
| 33 | - **Conservative**: -3% of account |
| 34 | - **Moderate**: -4% of account |
| 35 | - **Aggressive**: -5% of account |
| 36 | |
| 37 | Reset at midnight UTC. Three consecutive days hitting the daily limit triggers a weekly halt. |
| 38 | |
| 39 | ### 3. Weekly Loss Limits |
| 40 | |
| 41 | Reduce size or halt after weekly P&L reaches: |
| 42 | |
| 43 | - **Reduce size by 50%**: -5% weekly loss |
| 44 | - **Minimum size only**: -7% weekly loss |
| 45 | - **Full halt**: -10% weekly loss |
| 46 | |
| 47 | ### 4. Concentration Limits |
| 48 | |
| 49 | Maximum allocation to any single dimension: |
| 50 | |
| 51 | | Dimension | Max Concentration | |
| 52 | |---|---| |
| 53 | | Single token (blue chip) | 10% of account | |
| 54 | | Single token (mid-cap) | 5% | |
| 55 | | Single token (small-cap) | 2% | |
| 56 | | Single token (PumpFun/micro) | 0.5% | |
| 57 | | Single sector/narrative | 30% | |
| 58 | | Single strategy | 40% | |
| 59 | |
| 60 | ### 5. Exposure Limits |
| 61 | |
| 62 | Total deployed capital constraints: |
| 63 | |
| 64 | - **Normal conditions**: 50–80% deployed, 20–50% cash reserve |
| 65 | - **Elevated risk**: 30–50% deployed |
| 66 | - **Drawdown >10%**: 20–30% deployed |
| 67 | - **Max concurrent positions**: 5–10 depending on account size |
| 68 | |
| 69 | ### 6. Correlation Management |
| 70 | |
| 71 | Crypto assets correlate >0.7 during sell-offs. Effective diversification requires: |
| 72 | |
| 73 | - Treat all meme tokens as a single correlated bucket |
| 74 | - Limit total meme exposure to one position-size equivalent |
| 75 | - Diversify across *strategies* (trend, mean-reversion, scalp), not just tokens |
| 76 | - Monitor rolling correlation and reduce when correlations spike |
| 77 | |
| 78 | See `references/exposure_limits.md` for detailed limits by token type and strategy. |
| 79 | |
| 80 | ## Drawdown Management |
| 81 | |
| 82 | ### Response Framework |
| 83 | |
| 84 | | Drawdown | Status | Response | |
| 85 | |---|---|---| |
| 86 | | 0–5% | Normal | Continue trading at full size | |
| 87 | | 5–10% | Caution | Reduce position sizes by 25–50% | |
| 88 | | 10–15% | Warning | Minimum position sizes only | |
| 89 | | 15–20% | Critical | Halt new trades, manage existing positions only | |
| 90 | | >20% | Emergency | Full stop, review everything before resuming | |
| 91 | |
| 92 | ### Recovery Requirements |
| 93 | |
| 94 | | Loss | Required Gain to Recover | |
| 95 | |---|---| |
| 96 | | -5% | +5.3% | |
| 97 | | -10% | +11.1% | |
| 98 | | -15% | +17.6% | |
| 99 | | -20% | +25.0% | |
| 100 | | -30% | +42.9% | |
| 101 | | -40% | +66.7% | |
| 102 | | -50% | +100.0% | |
| 103 | |
| 104 | The asymmetry accelerates rapidly. Managing small drawdowns prevents them from becoming catastrophic. See `references/drawdown_management.md` for the full framework. |
| 105 | |
| 106 | ## Circuit Breakers |
| 107 | |
| 108 | Automated controls that restrict trading when conditions are met: |
| 109 | |
| 110 | ### Time-Based |
| 111 | - No trading for 24 hours after hitting daily loss limit |
| 112 | - 48-hour cooling period after weekly loss limit |
| 113 | - Mandatory weekly review day (no new positions) |
| 114 | |
| 115 | ### Loss-Based |
| 116 | - 3 consecutive losses → reduce size 50% |
| 117 | - 5 consecutive losses → minimum size only |
| 118 | - 7 consecutive losses → halt 24 hours, full review |
| 119 | |
| 120 | ### Volatility-Based |
| 121 | - Portfolio volatility >2× rolling average → reduce exposure 50% |
| 122 | - Market-wide liquidation events → pause all new entries |
| 123 | - Individual token volatility spike → exit or tighten stops |
| 124 | |
| 125 | ### Emotional (Self-Assessed) |
| 126 | - Recognize tilt: anger after losses, urge to "make it back" |
| 127 | - FOMO: rushing entries without proper analysis |
| 128 | - Overconfidence: increasing size after a win streak without justification |
| 129 | |
| 130 | See `references/circuit_breakers.md` for implementation details. |
| 131 | |
| 132 | ## Risk Metrics |
| 133 | |
| 134 | ### Value at Risk (VaR) |
| 135 | |
| 136 | 95th-percentile daily loss estimate using historical returns: |
| 137 | |
| 138 | ```python |
| 139 | import numpy as np |
| 140 | |
| 141 | def historical_var(returns: list[float], confidence: float = 0.95) -> float: |
| 142 | """Calculate historical VaR at given confidence level.""" |
| 143 | sorted_returns = sorted(returns) |
| 144 | index = int((1 - confidence) * len(sorted_returns)) |