---
title: Portfolio
description: Holdings, average cost basis, and unrealized P&L are derived automatically from your transaction history. There is no separate holdings table to maintain.
---

export const askRows = [
  { cmd: '"How\'s my portfolio?"',     desc: 'Positions, P&L, concentration, and the one thing to watch in a single answer' },
  { cmd: '"Is TSLA too big a chunk?"', desc: 'Concentration risk + scenario impact stitched together automatically' },
  { cmd: '"I just bought 10 NVDA at $875"', desc: <>Log a trade through plain conversation. Claude calls <code>add_txn</code> for you</> },
];

<Section label="Ask Claude">
  <CommandTable rows={askRows} />

  <Note>
    Claude composes <code>show_portfolio</code>, <code>show_concentration</code>,
    and <code>show_macro</code> automatically. The CLI section below is for
    when you want the same data in the terminal directly.
  </Note>
</Section>

<section className="section">
  <p className="section-label">firma show portfolio<Badge>power user</Badge></p>

Displays every current position with quantity, average cost per share,
current market price, and unrealized P&amp;L. Run <code>firma sync</code> first
if you want fresh prices.

<div className="terminal">
  <div className="terminal-line">
    <span className="term-prompt">$</span>
    <span className="term-cmd">firma show portfolio</span>
  </div>
  <table className="term-table">
    <thead>
      <tr><th>TICKER</th><th>TYPE</th><th>QTY</th><th>AVG</th><th>PRICE</th><th>YIELD</th><th>P&amp;L</th></tr>
    </thead>
    <tbody>
      <tr className="sep"><td colSpan={7}/></tr>
      <tr><td className="td-bold">MSFT</td><td className="td-muted">US stock</td><td>18</td><td className="td-muted">$421.32</td><td>$424.62</td><td className="td-muted">0.88%</td><td className="td-green">+$59.40 (+0.78%)</td></tr>
      <tr><td className="td-bold">TSLA</td><td className="td-muted">US stock</td><td>400</td><td className="td-muted">$249.91</td><td>$376.30</td><td className="td-muted">─</td><td className="td-green">+$50,556.43 (+50.57%)</td></tr>
      <tr><td className="td-bold">AAPL</td><td className="td-muted">US stock</td><td>43</td><td className="td-muted">$196.29</td><td>$271.06</td><td className="td-muted">0.38%</td><td className="td-green">+$3,215.11 (+38.09%)</td></tr>
      <tr><td className="td-bold">NVDA</td><td className="td-muted">US stock</td><td>156</td><td className="td-muted">$128.05</td><td>$208.27</td><td className="td-muted">0.02%</td><td className="td-green">+$12,514.80 (+62.65%)</td></tr>
      <tr className="sep"><td colSpan={7}/></tr>
    </tbody>
    <tfoot>
      <tr><td className="td-muted">Value</td><td colSpan={6}>$202,308.86</td></tr>
      <tr><td className="td-muted">Cost</td><td colSpan={6}>$135,963.12</td></tr>
      <tr><td className="td-muted">P&amp;L</td><td colSpan={6} className="td-green">+$66,345.74  +48.80%</td></tr>
      <tr><td className="td-muted">Synced</td><td colSpan={6} className="td-muted">0m ago</td></tr>
    </tfoot>
  </table>
</div>

  <Note>
    AVG is the weighted average cost across all buy and deposit transactions.
    YIELD is the annual dividend yield from Finnhub. Blank for non-dividend tickers.
    TYPE shows the market for a stock (<code>US stock</code>, <code>KRX stock</code>, …)
    and the asset class for a non-stock holding (<code>crypto</code>, <code>commodity</code>,
    <code>real_estate</code>). Non-stock holdings have no price feed — set their value
    with <code>firma add price</code>, and the row shows how stale that price is.
    Pass <code>-c &lt;currency&gt;</code> to render every figure in another currency.
  </Note>
</section>

<Section label="Allocation & Net Worth Breakdown">
Below the holdings table, <code>firma show portfolio</code> also shows sector
and country allocation bars, plus a net worth snapshot based on your latest balance entry.

<div className="terminal">
  <pre className="term-pre">{`Sector Allocation
  Automobiles           ━━━━━━━━━━━━━━━─────  74.4%
  Semiconductors        ━━━─────────────────  16.1%
  Technology            ━━──────────────────   9.5%

Country Allocation
  US                    ━━━━━━━━━━━━━━━━━━━━  100.0%

Net Worth Breakdown
  Investments     ━━━━━━━━━━━━━───────  $273,641  64.0%
  Other Assets    ━━━━━───────────────  $109,935  25.7%
  Cash            ━━──────────────────   $44,188  10.3%

  Net Worth                               $426,691  2026-03
  Portfolio MV                            $202,308.86`}</pre>
</div>

  <Note>
    Net Worth Breakdown uses the most recent balance entry. Run{' '}
    <code>firma add balance</code> monthly to keep it current.
  </Note>
</Section>

<Section label="firma sync">
Fetches current market prices for every ticker in your portfolio from Finnhub
and caches them locally. This requires a Finnhub API key, which you can set once with
<code>firma config set finnhub-key &lt;key&gt;</code>.

  <Terminal
    command="firma sync"
    rows={[
      { type: 'beat', text: 'TSLA  $376.30' },
      { type: 'beat', text: 'NVDA  $208.27' },
      { type: 'beat', text: 'MSFT  $412.50' },
      { type: 'beat', text: 'AAPL  $209.80' },
      { type: 'meta', text: 'Synced 4 tickers at 8:35 AM' },
    ]}
  />

  <Note>
    Prices are cached locally. Firma never calls Finnhub unless you run
    <code>firma sync</code> or ask Claude to run <code>sync</code>.
    Free Finnhub keys support up to 60 API calls/minute.
  </Note>
</Section>
