---
title: Risk Metrics
description: Volatility, drawdown, Sharpe, Sortino, and beta, all calculated from your actual snapshot history. It helps you see whether your returns came from skill, leverage, or simply enduring a rough ride.
---

export const metrics = [
  {
    icon: 'vol',
    title: 'Volatility',
    desc: 'Standard deviation of daily returns, annualized (×√252). Higher numbers mean wider day-to-day swings. Concentrated portfolios often land around 25-35%, while broad-market funds are usually closer to 12-18%.',
  },
  {
    icon: 'dd',
    title: 'Drawdown',
    desc: 'Peak-to-trough decline. Max drawdown shows the worst stretch you lived through, while current drawdown shows how far you are from your all-time high today.',
  },
  {
    icon: 'shr',
    title: 'Sharpe Ratio',
    desc: "Excess return per unit of total volatility. Above 1 is solid, above 2 is excellent, and below 0 means you'd have been better off in T-bills.",
  },
  {
    icon: 'sor',
    title: 'Sortino Ratio',
    desc: 'Like Sharpe, but it only penalizes downside volatility. That makes it more useful when upside swings are not something you consider a real risk.',
  },
  {
    icon: 'β',
    title: 'Beta',
    desc: 'Sensitivity to market moves. β = 1 means you generally move with the benchmark. β = 1.5 means a 1% market move tends to move your portfolio 1.5%, while β = 0.7 means a milder response.',
  },
  {
    icon: 'win',
    title: 'Win Rate',
    desc: 'Percent of days with positive returns. A high win rate paired with a weak Sharpe often means lots of small wins were wiped out by a few large losses.',
  },
];

export const optionsRows = [
  { cmd: '--from / --to',     desc: 'Date range (default: all available snapshots → today)' },
  { cmd: '-b, --benchmark',   desc: 'Ticker for beta calculation (default: SPY)' },
  { cmd: '--rf <rate>',        desc: 'Annual risk-free rate % for Sharpe / Sortino (default: 5.0)' },
  { cmd: '--json',             desc: 'Output as JSON for scripting' },
];

<Section label="firma show risk">
Computes portfolio risk metrics from daily snapshot data. Beta is
calculated against SPY by default (or a custom benchmark) when a Finnhub
key is configured. Sharpe and Sortino assume a 5% annual risk-free rate
unless overridden.

<div className="terminal">
  <div className="terminal-line">
    <span className="term-prompt">$</span>
    <span className="term-cmd">firma show risk</span>
  </div>
  <pre className="term-pre"><span className="d">Risk Metrics</span></pre>
  <div className="terminal-block">
    <div className="term-row"><span className="term-meta" style={{color:'var(--muted)'}}>  Period</span><span className="term-val">2024-01-02 → 2026-04-27  (320 days)</span></div>
    <div className="term-row" style={{marginTop:'0.5rem'}}><span className="term-meta">Returns</span></div>
    <div className="term-row"><span className="term-meta">  Total</span><span className="term-val td-green">+61.23%</span></div>
    <div className="term-row"><span className="term-meta">  Annualized</span><span className="term-val td-green">+28.47%</span></div>
    <div className="term-row" style={{marginTop:'0.5rem'}}><span className="term-meta">Volatility</span></div>
    <div className="term-row"><span className="term-meta">  Daily std dev</span><span className="term-val td-muted">1.82%</span></div>
    <div className="term-row"><span className="term-meta">  Annualized</span><span className="term-val td-muted">28.91%</span></div>
    <div className="term-row" style={{marginTop:'0.5rem'}}><span className="term-meta">Drawdown</span></div>
    <div className="term-row"><span className="term-meta">  Max drawdown</span><span className="term-val td-orange">-22.40%</span></div>
    <div className="term-row"><span className="term-meta">  Current from ATH</span><span className="term-val td-orange">-8.30%</span></div>
    <div className="term-row" style={{marginTop:'0.5rem'}}><span className="term-meta">Risk-Adjusted Ratios <span style={{color:'var(--muted)'}}>(rf = 5.0%)</span></span></div>
    <div className="term-row"><span className="term-meta">  Sharpe</span><span className="term-val">1.23</span></div>
    <div className="term-row"><span className="term-meta">  Sortino</span><span className="term-val">1.87</span></div>
    <div className="term-row" style={{marginTop:'0.5rem'}}><span className="term-meta">Beta vs SPY</span></div>
    <div className="term-row"><span className="term-meta">  Beta</span><span className="term-val">1.450 <span style={{color:'var(--muted)'}}>more volatile than market</span></span></div>
  </div>
</div>

  <Note>
    Requires at least 10 daily snapshots. Run <code>firma add snapshot</code>
    regularly, or lean on <code>firma brief</code>, which auto-snaps if today's
    entry is missing.
  </Note>
</Section>

<Section label="What Each Metric Means">
  <FeatureList items={metrics} />
</Section>

<Section label="Options">
  <CommandTable rows={optionsRows} />
</Section>
