ワンクリックで
risk-management
Portfolio-level risk controls, drawdown management, exposure limits, and circuit breakers for crypto trading
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Portfolio-level risk controls, drawdown management, exposure limits, and circuit breakers for crypto trading
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Kalshi exchange mechanics — RSA-PSS auth, order schema, YES/NO orderbook convention, WebSocket, and endpoint surface. Market-type-agnostic shared layer for all Kalshi skills.
Kalshi daily and hourly range markets on crypto prices (BTC, ETH) and equity indices (S&P 500, Nasdaq-100) — bracket structure, Gaussian P(YES) modeling on price/vol, close-offset decision timing, longshot-sell edge with honest evidence bounds
Daily temperature high/low bracket and threshold contracts on Kalshi — contract structure, forecast→P(YES) map, settlement rules, cross-venue divergences, and weather-specific pitfalls
Polymarket exchange mechanics — on-chain Polygon CTF, Gamma/CLOB/Data APIs, EIP-712 auth, identifier model, WebSocket, settlement, and geo/KYC constraint
Venue- and market-type-agnostic strategy, sizing, and backtesting layer for binary prediction markets (Kalshi, Polymarket, ForecastEx). Covers the durable edge thesis, fee-aware selection, fractional-Kelly sizing, and leak-free validation methodology.
Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators
| name | risk-management |
| description | Portfolio-level risk controls, drawdown management, exposure limits, and circuit breakers for crypto trading |
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.
Every decision must respect this priority order:
Violating this hierarchy (chasing growth at the expense of survival) is the primary cause of account blowups.
Halt trading when portfolio drawdown from equity peak reaches a threshold:
| Account Type | Max Drawdown | Action |
|---|---|---|
| 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.
Stop opening new positions after daily P&L (realized + unrealized) hits:
Reset at midnight UTC. Three consecutive days hitting the daily limit triggers a weekly halt.
Reduce size or halt after weekly P&L reaches:
Maximum allocation to any single dimension:
| Dimension | Max 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/narrative | 30% |
| Single strategy | 40% |
Total deployed capital constraints:
Crypto assets correlate >0.7 during sell-offs. Effective diversification requires:
See references/exposure_limits.md for detailed limits by token type and strategy.
| Drawdown | Status | Response |
|---|---|---|
| 0–5% | Normal | Continue trading at full size |
| 5–10% | Caution | Reduce position sizes by 25–50% |
| 10–15% | Warning | Minimum position sizes only |
| 15–20% | Critical | Halt new trades, manage existing positions only |
| >20% | Emergency | Full stop, review everything before resuming |
| Loss | Required 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.
Automated controls that restrict trading when conditions are met:
See references/circuit_breakers.md for implementation details.
95th-percentile daily loss estimate using historical returns:
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%
Average loss in the worst (1 - confidence)% of scenarios:
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
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
token-holder-analysis skill for red flagsslippage-modeling skill for detailed cost estimationPumpFun and similar meme token platforms require a distinct risk approach:
Treat every PumpFun trade as a potential 100% loss. Size accordingly.
position-sizing: Use risk limits from this skill to constrain position sizesexit-strategies: Circuit breakers override exit strategies (forced exits)portfolio-analytics: Feed portfolio metrics back for risk assessmentliquidity-analysis: Adjust position limits based on available liquidityslippage-modeling: Factor execution costs into risk calculationsreferences/drawdown_management.md — Drawdown math, response framework, causes, and remediationreferences/exposure_limits.md — Position limits by token type, portfolio limits, correlation managementreferences/circuit_breakers.md — Implementation details for all circuit breaker typesscripts/risk_dashboard.py — Portfolio risk dashboard with limit checking and color-coded statusscripts/drawdown_analyzer.py — Equity curve drawdown analysis with response recommendations# Run the risk dashboard with demo data
python scripts/risk_dashboard.py --demo
# Analyze drawdowns on a demo equity curve
python scripts/drawdown_analyzer.py --demo