risk-management

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Risk Management

风险管理

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.
针对加密货币及Solana交易的组合层面风险控制。本Skill提供回撤管理、风险敞口限制、熔断机制以及加密货币专属风险考量的框架。

Risk Management Hierarchy

风险管理优先级

Every decision must respect this priority order:
  1. Survival — Never risk account ruin. No single trade, day, or week should threaten your ability to continue trading.
  2. Capital preservation — Protect what you have. Losses compound geometrically; recovery requires outsized gains.
  3. Growth — Only after survival and preservation are secured, pursue returns.
Violating this hierarchy (chasing growth at the expense of survival) is the primary cause of account blowups.
所有决策必须遵循以下优先级顺序:
  1. 生存 — 绝不能让账户面临破产风险。任何单笔交易、单日或单周的操作都不应威胁到你持续交易的能力。
  2. 资本保值 — 保护你已有的资本。亏损会呈几何级数复利增长;恢复亏损需要获得远超亏损幅度的收益。
  3. 增长 — 只有在生存和保值得到保障后,再追求收益。
违反这一优先级(为追求增长而牺牲生存)是账户爆仓的主要原因。

Portfolio-Level Controls

组合层面控制措施

1. Maximum Drawdown Limits

1. 最大回撤限制

Halt trading when portfolio drawdown from equity peak reaches a threshold:
Account TypeMax DrawdownAction
Conservative-15%Full stop, review all strategies
Moderate-20%Full stop, reduce to minimum size on recovery
Aggressive-25%Full stop, mandatory cooling period
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.
当组合从权益峰值的回撤达到阈值时,停止交易:
账户类型最大回撤应对措施
保守型-15%完全停止交易,复盘所有策略
稳健型-20%完全停止交易,恢复阶段仅用最小仓位
激进型-25%完全停止交易,强制冷静期
回撤恢复的数学逻辑凸显了这一控制的重要性:回撤20%需要25%的收益才能恢复;回撤50%则需要100%的收益才能恢复。完整的回撤恢复表请查看
references/drawdown_management.md

2. Daily Loss Limits

2. 单日亏损限制

Stop opening new positions after daily P&L (realized + unrealized) hits:
  • Conservative: -3% of account
  • Moderate: -4% of account
  • Aggressive: -5% of account
Reset at midnight UTC. Three consecutive days hitting the daily limit triggers a weekly halt.
当日盈亏(已实现+未实现)达到以下阈值后,停止开新仓:
  • 保守型:账户资金的-3%
  • 稳健型:账户资金的-4%
  • 激进型:账户资金的-5%
每日UTC午夜重置。连续三天触发单日亏损限制将触发周度交易暂停。

3. Weekly Loss Limits

3. 周度亏损限制

Reduce size or halt after weekly P&L reaches:
  • Reduce size by 50%: -5% weekly loss
  • Minimum size only: -7% weekly loss
  • Full halt: -10% weekly loss
当周度盈亏达到以下阈值时,降低仓位或停止交易:
  • 仓位减半:周度亏损-5%
  • 仅用最小仓位:周度亏损-7%
  • 完全停止交易:周度亏损-10%

4. Concentration Limits

4. 集中度限制

Maximum allocation to any single dimension:
DimensionMax Concentration
Single token (blue chip)10% of account
Single token (mid-cap)5%
Single token (small-cap)2%
Single token (PumpFun/micro)0.5%
Single sector/narrative30%
Single strategy40%
单一维度的最大配置比例:
维度最大集中度
单一蓝筹代币账户资金的10%
单一中型市值代币5%
单一小型市值代币2%
单一PumpFun/微型代币0.5%
单一板块/叙事主题30%
单一策略40%

5. Exposure Limits

5. 风险敞口限制

Total deployed capital constraints:
  • Normal conditions: 50–80% deployed, 20–50% cash reserve
  • Elevated risk: 30–50% deployed
  • Drawdown >10%: 20–30% deployed
  • Max concurrent positions: 5–10 depending on account size
总部署资金约束:
  • 正常市场环境:50–80%资金部署,20–50%现金储备
  • 高风险环境:30–50%资金部署
  • 回撤>10%:20–30%资金部署
  • 最大并发仓位数量:根据账户规模为5–10个

6. Correlation Management

6. 相关性管理

Crypto assets correlate >0.7 during sell-offs. Effective diversification requires:
  • Treat all meme tokens as a single correlated bucket
  • Limit total meme exposure to one position-size equivalent
  • Diversify across strategies (trend, mean-reversion, scalp), not just tokens
  • Monitor rolling correlation and reduce when correlations spike
See
references/exposure_limits.md
for detailed limits by token type and strategy.
加密资产在下跌期间的相关性>0.7。有效的分散化需要:
  • 将所有迷因代币视为单一相关资产组
  • 将迷因代币总敞口限制在单一仓位规模的等价水平
  • 策略(趋势、均值回归、 scalp)分散,而不仅仅是跨代币
  • 监控滚动相关性,在相关性飙升时降低敞口
按代币类型和策略划分的详细限制请查看
references/exposure_limits.md

Drawdown Management

回撤管理

Response Framework

应对框架

DrawdownStatusResponse
0–5%NormalContinue trading at full size
5–10%CautionReduce position sizes by 25–50%
10–15%WarningMinimum position sizes only
15–20%CriticalHalt new trades, manage existing positions only
>20%EmergencyFull stop, review everything before resuming
回撤幅度状态应对措施
0–5%正常保持全仓位交易
5–10%警示仓位降低25–50%
10–15%警告仅使用最小仓位
15–20%危急停止开新仓,仅管理现有仓位
>20%紧急完全停止交易,复盘所有内容后再恢复交易

Recovery Requirements

恢复要求

LossRequired Gain to Recover
-5%+5.3%
-10%+11.1%
-15%+17.6%
-20%+25.0%
-30%+42.9%
-40%+66.7%
-50%+100.0%
The asymmetry accelerates rapidly. Managing small drawdowns prevents them from becoming catastrophic. See
references/drawdown_management.md
for the full framework.
亏损幅度恢复所需收益
-5%+5.3%
-10%+11.1%
-15%+17.6%
-20%+25.0%
-30%+42.9%
-40%+66.7%
-50%+100.0%
这种不对称性会迅速加剧。管理小回撤可以防止其演变为灾难性亏损。完整框架请查看
references/drawdown_management.md

Circuit Breakers

熔断机制

Automated controls that restrict trading when conditions are met:
当满足特定条件时自动限制交易的控制措施:

Time-Based

时间触发型

  • No trading for 24 hours after hitting daily loss limit
  • 48-hour cooling period after weekly loss limit
  • Mandatory weekly review day (no new positions)
  • 触发单日亏损限制后24小时内禁止交易
  • 触发周度亏损限制后进入48小时冷静期
  • 强制每周复盘日(禁止开新仓)

Loss-Based

亏损触发型

  • 3 consecutive losses → reduce size 50%
  • 5 consecutive losses → minimum size only
  • 7 consecutive losses → halt 24 hours, full review
  • 连续3次亏损 → 仓位减半
  • 连续5次亏损 → 仅用最小仓位
  • 连续7次亏损 → 暂停交易24小时,全面复盘

Volatility-Based

波动率触发型

  • Portfolio volatility >2× rolling average → reduce exposure 50%
  • Market-wide liquidation events → pause all new entries
  • Individual token volatility spike → exit or tighten stops
  • 组合波动率>滚动平均值的2倍 → 敞口降低50%
  • 全市场清算事件 → 暂停所有新入场操作
  • 单个代币波动率飙升 → 平仓或收紧止损

Emotional (Self-Assessed)

情绪触发型(自我评估)

  • Recognize tilt: anger after losses, urge to "make it back"
  • FOMO: rushing entries without proper analysis
  • Overconfidence: increasing size after a win streak without justification
See
references/circuit_breakers.md
for implementation details.
  • 识别心态失衡:亏损后的愤怒、急于"扳回"的冲动
  • FOMO(害怕错过):未经充分分析就匆忙入场
  • 过度自信:连胜后无理由地加大仓位
实现细节请查看
references/circuit_breakers.md

Risk Metrics

风险指标

Value at Risk (VaR)

风险价值(VaR)

95th-percentile daily loss estimate using historical returns:
python
import numpy as np

def historical_var(returns: list[float], confidence: float = 0.95) -> float:
    """Calculate historical VaR at given confidence level."""
    sorted_returns = sorted(returns)
    index = int((1 - confidence) * len(sorted_returns))
    return abs(sorted_returns[index])
使用历史收益计算的95%分位数单日亏损估计:
python
import numpy as np

def historical_var(returns: list[float], confidence: float = 0.95) -> float:
    """Calculate historical VaR at given confidence level."""
    sorted_returns = sorted(returns)
    index = int((1 - confidence) * len(sorted_returns))
    return abs(sorted_returns[index])

Example: 95% VaR of 3.2% means on 95% of days, loss won't exceed 3.2%

Example: 95% VaR of 3.2% means on 95% of days, loss won't exceed 3.2%

undefined
undefined

Expected Shortfall (CVaR)

预期短缺(CVaR)

Average loss in the worst (1 - confidence)% of scenarios:
python
def expected_shortfall(returns: list[float], confidence: float = 0.95) -> float:
    """Average loss beyond VaR threshold."""
    sorted_returns = sorted(returns)
    index = int((1 - confidence) * len(sorted_returns))
    tail = sorted_returns[:index]
    return abs(sum(tail) / len(tail)) if tail else 0.0
最坏(1 - 置信水平)%场景下的平均亏损:
python
def expected_shortfall(returns: list[float], confidence: float = 0.95) -> float:
    """Average loss beyond VaR threshold."""
    sorted_returns = sorted(returns)
    index = int((1 - confidence) * len(sorted_returns))
    tail = sorted_returns[:index]
    return abs(sum(tail) / len(tail)) if tail else 0.0

Maximum Drawdown

最大回撤

python
def max_drawdown(equity_curve: list[float]) -> float:
    """Peak-to-trough decline as a fraction."""
    peak = equity_curve[0]
    max_dd = 0.0
    for value in equity_curve:
        peak = max(peak, value)
        dd = (peak - value) / peak
        max_dd = max(max_dd, dd)
    return max_dd
python
def max_drawdown(equity_curve: list[float]) -> float:
    """Peak-to-trough decline as a fraction."""
    peak = equity_curve[0]
    max_dd = 0.0
    for value in equity_curve:
        peak = max(peak, value)
        dd = (peak - value) / peak
        max_dd = max(max_dd, dd)
    return max_dd

Additional Metrics

其他指标

  • Win/loss streak tracking: Detect hot/cold streaks for circuit breaker logic
  • Rolling Sharpe ratio: 30-day rolling risk-adjusted returns
  • Calmar ratio: Annualized return / max drawdown
  • Sortino ratio: Return / downside deviation (penalizes only negative volatility)
  • 盈亏 streak 跟踪:检测连续盈利/亏损情况,用于熔断机制逻辑
  • 滚动夏普比率:30天滚动风险调整后收益
  • Calmar比率:年化收益 / 最大回撤
  • Sortino比率:收益 / 下行偏差(仅惩罚负波动率)

Crypto-Specific Risks

加密货币专属风险

Smart Contract Risk

智能合约风险

  • Never allocate >5% of account to a single unaudited protocol
  • Diversify across audited protocols for yield strategies
  • Monitor exploit databases and social channels for emerging threats
  • 绝不将超过账户资金5%的资金分配给单个未审计协议
  • 跨多个已审计协议分散配置收益策略资金
  • 监控漏洞数据库和社交渠道,关注潜在威胁

Rug Pull Risk

跑路风险(Rug Pull)

  • Size inversely with token age: newer tokens get smaller positions
  • Verify: locked liquidity, renounced mint authority, holder distribution
  • Cross-reference with
    token-holder-analysis
    skill for red flags
  • 仓位规模与代币存续时间成反比:新代币使用更小仓位
  • 验证:锁定流动性、放弃铸币权限、持有者分布情况
  • 结合
    token-holder-analysis
    Skill排查风险信号

Bridge and Custody Risk

跨链桥及托管风险

  • Don't hold >20% on any single platform or bridge
  • Self-custody the majority of trading capital
  • Budget for bridge fees and delays in execution planning
  • 任何单一平台或跨链桥的持仓不超过20%
  • 交易资金的大部分采用自我托管
  • 在执行计划中预留跨链桥费用和延迟的预算

MEV and Execution Risk

MEV及执行风险

  • Budget 1–3% for MEV/slippage on Solana DEX trades
  • Use priority fees during congestion
  • See
    slippage-modeling
    skill for detailed cost estimation
  • Solana DEX交易预留1–3%的MEV/滑点预算
  • 拥堵时段使用优先费用
  • 详细的成本估算请查看
    slippage-modeling
    Skill

Correlation Spikes

相关性飙升

  • In crashes, crypto correlations approach 1.0
  • Your "diversified" portfolio may behave as one position
  • Stress-test portfolio assuming all positions drop simultaneously
  • 暴跌期间,加密资产的相关性趋近于1.0
  • 你的"分散化"组合可能表现得像单一仓位
  • 假设所有仓位同时下跌,对组合进行压力测试

PumpFun Risk Framework

PumpFun风险框架

PumpFun and similar meme token platforms require a distinct risk approach:
PumpFun及类似迷因代币平台需要独特的风险应对方法:

Core Principle

核心原则

Treat every PumpFun trade as a potential 100% loss. Size accordingly.
将每笔PumpFun交易视为可能100%亏损的操作,据此确定仓位规模。

Position Limits

仓位限制

  • Per-token maximum: 0.1–0.5 SOL
  • Daily PumpFun budget: Fixed allocation (e.g., 2 SOL/day)
  • Never exceed budget: When daily allocation is gone, stop
  • 单一代币上限:0.1–0.5 SOL
  • 每日PumpFun预算:固定分配(例如,每日2 SOL)
  • 绝不超预算:当日分配资金用尽后停止交易

Tracking

跟踪

  • Track PumpFun P&L separately from main portfolio
  • Calculate PumpFun win rate and expectancy independently
  • Don't let PumpFun losses affect main portfolio risk limits
  • 将PumpFun盈亏与主组合分开跟踪
  • 独立计算PumpFun的胜率和期望收益
  • 不让PumpFun的亏损影响主组合的风险限制

Risk Adjustments

风险调整

  • No stop-losses on PumpFun (assume 100% loss at entry)
  • Take profits aggressively: 2×, 3×, 5× partial exits
  • Time-based exit: close within hours, not days
  • PumpFun交易不设置止损(入场时即假设100%亏损)
  • 激进止盈:在2倍、3倍、5倍收益时部分平仓
  • 基于时间的离场:数小时内平仓,而非数天

Integration with Other Skills

与其他Skill集成

  • position-sizing
    : Use risk limits from this skill to constrain position sizes
  • exit-strategies
    : Circuit breakers override exit strategies (forced exits)
  • portfolio-analytics
    : Feed portfolio metrics back for risk assessment
  • liquidity-analysis
    : Adjust position limits based on available liquidity
  • slippage-modeling
    : Factor execution costs into risk calculations
  • position-sizing
    :使用本Skill的风险限制约束仓位规模
  • exit-strategies
    :熔断机制优先于离场策略(强制平仓)
  • portfolio-analytics
    :将组合指标反馈用于风险评估
  • liquidity-analysis
    :根据可用流动性调整仓位限制
  • slippage-modeling
    :将执行成本纳入风险计算

Files

文件

References

参考文档

  • references/drawdown_management.md
    — Drawdown math, response framework, causes, and remediation
  • references/exposure_limits.md
    — Position limits by token type, portfolio limits, correlation management
  • references/circuit_breakers.md
    — Implementation details for all circuit breaker types
  • references/drawdown_management.md
    — 回撤数学逻辑、应对框架、原因及补救措施
  • references/exposure_limits.md
    — 按代币类型划分的仓位限制、组合限制、相关性管理
  • references/circuit_breakers.md
    — 所有熔断机制类型的实现细节

Scripts

脚本

  • scripts/risk_dashboard.py
    — Portfolio risk dashboard with limit checking and color-coded status
  • scripts/drawdown_analyzer.py
    — Equity curve drawdown analysis with response recommendations
  • scripts/risk_dashboard.py
    — 组合风险仪表盘,包含限制检查和颜色编码状态
  • scripts/drawdown_analyzer.py
    — 权益曲线回撤分析及应对建议

Quick Start

快速开始

bash
undefined
bash
undefined

Run the risk dashboard with demo data

使用演示数据运行风险仪表盘

python scripts/risk_dashboard.py --demo
python scripts/risk_dashboard.py --demo

Analyze drawdowns on a demo equity curve

分析演示权益曲线的回撤情况

python scripts/drawdown_analyzer.py --demo
undefined
python scripts/drawdown_analyzer.py --demo
undefined