MarketDeck docs
risk
Unified portfolio risk metrics, liquidation distance, margin, scenarios, drawdown, and kill-switch checks.
marketdeck risk is the read-only operator surface for portfolio risk. It combines balances, positions, and paper state through the CLI-first core and returns the same JSON contract used by plugins and automation.
Usage#
marketdeck risk <summary|exposure|stress|liquidation|margin|scenarios|drawdown|kill-switch|limits|preflight> [flags]
| Subcommand | What it does | ||
|---|---|---|---|
summary | Equity, gross/net notional, leverage, position count, concentration, and optional limit checks. | ||
| `exposure [--by coin | wallet | exchange]` | Gross, long, and short notional grouped for scan views. |
stress [--shock-pct N] [--shocks A,B,C] | Legacy uniform portfolio shock table. | ||
liquidation [--min-distance-pct N] | Estimated isolated liquidation price and mark-distance per position. | ||
margin | Used/free margin and leverage grouped by wallet and exchange. | ||
scenarios [--shock BTC=-10,ETH=-15] [--default-shock-pct N] | Coin-specific shock simulation with estimated PnL and equity after the scenario. | ||
drawdown [--from D] [--to D] | Paper equity drawdown from persisted equity snapshots. | ||
kill-switch [flags] | Combines limit, liquidation-distance, and scenario-equity gates into actionable findings. | ||
limits | Evaluate supplied leverage, notional, concentration, and position-count limits. | ||
preflight | Same checks as limits, but exits non-zero when a supplied limit fails. For concrete order readiness use marketdeck safety preflight --action .... |
Examples#
marketdeck risk summary --format json
marketdeck risk liquidation --min-distance-pct 15
marketdeck risk margin --format json
marketdeck risk scenarios --shock BTC=-10,ETH=-15 --default-shock-pct -5
marketdeck risk drawdown --from 2026-01-01
marketdeck risk kill-switch --max-gross-leverage 2 --min-liq-distance-pct 15 --scenario BTC=-10 --min-equity-usd 5000
marketdeck risk preflight --max-gross-leverage 2 --max-positions 8
The command is read-only. kill-switch reports whether configured gates are breached; it does not close positions or cancel orders.