Skip to content

What (One-liner)

The "risk management" node on Canvas — auto-collects the symbol from the upstream price_factor and POSTs to /portfolio/risk-metrics. The full risk math is documented on the route card (portfolio_risk_metrics).

How to use

Drag risk_management_v1 onto the Canvas, wire one upstream price_factor_v1 node (or fill params.symbol). Optional benchmark (default SPY) + period (default '1y'). Output is the complete risk dict.

Core formulas

This graphlet computes nothing — it is Canvas wiring + defaults:

ts
// frontend/src/components/modern/unified-canvas/ExecutionRouter.ts:1913
upstream_syms = getUpstreamPFSymbols(node.id)
symbol = upstream_syms[0] || params.symbol || 'SPY'
POST /portfolio/risk-metrics {
  symbol: normalizeSymbol(symbol),
  benchmark: normalizeSymbol(params.benchmark || 'SPY'),
  period: params.period || '1y',
}

The risk formulas (VaR / CVaR / Beta / MaxDD / Sharpe) are fully documented on the portfolio_risk_metrics card.

Assumptions & applicability

Assumptions: upstream price_factor supplies the symbol; the /portfolio/risk-metrics route is up; normalizeSymbol aliasing is correct.

Fits: adding a risk overlay before the portfolio output in Canvas strategy graphs; a quick historical VaR / CVaR / Beta node.

Does not fit: multi-asset aggregation; custom confidence levels; non-Canvas use (call the route directly).

Input / Output contract

Canvas params: {symbol?, benchmark?, period?} → the full route response + Canvas metadata (label, nodeId, executionTime, status, _source).

Known limitations

  1. The Canvas wrapper does not expose custom confidence_levels / risk_free_rate
  2. With multiple upstream price_factors, only [0] is used
  3. Route-level limitations: see the portfolio_risk_metrics card

References

Full references live on the portfolio_risk_metrics card (Jorion 2006, Artzner et al. 1999 CVaR theory, etc.).

Golden Test

This graphlet shares its golden with the portfolio_risk_metrics route (one suite verifies wiring + route math). 1e-10 tolerance. 6 tests in tests/golden/python/test_portfolio_risk_metrics_golden.py.

Changelog

  • 1.0.0 (2026-04-20) — First Active (points at the real route after the 2026-04-20 legacy cleanup)

Verifiable intelligence for the decisions that demand scrutiny.