---
title: Transactions
description: Transactions are the source of truth for your portfolio. Holdings and average cost are derived from them. There is no separate holdings table to keep in sync.
---

<Section label="firma show txns [ticker]">
Lists all transactions with their running average cost after each entry.
Pass a ticker to filter to a single holding. The **ID** column
is used when editing or deleting a specific record.

<div className="terminal">
  <div className="terminal-line">
    <span className="term-prompt">$</span>
    <span className="term-cmd">firma show txns TSLA</span>
  </div>
  <table className="term-table">
    <thead>
      <tr><th>ID</th><th>DATE</th><th>TYPE</th><th>SHARES</th><th>PRICE</th><th>TOTAL</th><th>AVG COST</th></tr>
    </thead>
    <tbody>
      <tr className="sep"><td colSpan={7}/></tr>
      <tr><td className="td-muted">#86</td><td className="td-muted">2026-04-08</td><td className="td-green">buy</td><td>5</td><td>$351.69</td><td>$1,758.43</td><td className="td-muted">$245.68</td></tr>
      <tr><td className="td-muted">#8</td><td className="td-muted">2026-04-01</td><td className="td-green">buy</td><td>5</td><td>$354.75</td><td>$1,773.75</td><td className="td-muted">$244.24</td></tr>
      <tr><td className="td-muted">#39</td><td className="td-muted">2026-03-25</td><td className="td-green">buy</td><td>8</td><td>$387.85</td><td>$3,102.80</td><td className="td-muted">$242.72</td></tr>
      <tr><td className="td-muted">#28</td><td className="td-muted">2026-02-28</td><td className="td-green">buy</td><td>18</td><td>$396.37</td><td>$7,134.66</td><td className="td-muted">$237.22</td></tr>
      <tr><td className="td-muted">#101</td><td className="td-muted">2025-11-17</td><td className="td-green">buy</td><td>8</td><td>$406.45</td><td>$3,251.60</td><td className="td-muted">$228.60</td></tr>
      <tr><td className="td-muted">#1</td><td className="td-muted">2025-01-02</td><td className="td-muted">deposit</td><td>100</td><td>$78.00</td><td>$7,800.00</td><td className="td-muted">$78.00</td></tr>
      <tr className="sep"><td colSpan={7}/></tr>
    </tbody>
    <tfoot>
      <tr><td className="td-muted" colSpan={7}>24 transactions</td></tr>
    </tfoot>
  </table>
</div>

  <Note>
    Transaction types: <code>buy</code>, <code>sell</code>, <code>deposit</code> (transfer-in),
    <code>dividend</code>, <code>tax</code>.
    Only <code>buy</code> and <code>deposit</code> with a price affect average cost.
  </Note>
</Section>

<Section label="firma add txn">
Interactive prompts for recording a new transaction. Average cost is
recalculated automatically after each entry.

  <Terminal
    command="firma add txn"
    rows={[
      { type: 'val',  label: '◆  Asset type',       value: 'Stock' },
      { type: 'val',  label: '◆  Type',             value: 'buy' },
      { type: 'val',  label: '◆  Market',           value: 'US' },
      { type: 'val',  label: '◆  Stock',            value: 'AAPL' },
      { type: 'val',  label: '◆  Shares',           value: '15' },
      { type: 'val',  label: '◆  Price (USD)',      value: '$211.00' },
      { type: 'val',  label: '◆  Date',             value: '2026-04-25' },
      { type: 'beat', text:  'Transaction recorded.  AAPL avg cost → $196.40' },
    ]}
  />

  <Note>
    The first prompt is the asset type. <strong>Stock</strong> asks for a market
    (US, KRX, JP, HK, and more) and a ticker. A non-stock type (crypto, commodity,
    real estate) asks for a free-form name and a currency instead — value those
    holdings with <code>firma add price</code>. Amounts are entered in the asset's
    own currency and stored in USD.
  </Note>

  <Note>
    You can also add trades from Claude Desktop. Say "I bought 15 AAPL at $211"
    and Claude calls <code>add_txn</code> directly.
  </Note>
</Section>

<Section label="firma edit txn [id]">
Edit an existing transaction by ID. If you omit the ID, an interactive
picker lets you select from your recent transactions.
Only the fields you change are updated. The rest stay as-is.

  <Terminal
    command="firma edit txn 86"
    rows={[
      { type: 'val',  label: <>◆  Price per share <span style={{color:'var(--muted)'}}>($351.69)</span></>, value: '$349.00' },
      { type: 'beat', text:  'Transaction #86 updated.' },
    ]}
  />
</Section>

<Section label="firma delete txn [id]">
Delete a transaction permanently. Holdings and average cost are
recalculated immediately. Omit the ID for an interactive picker.

  <Terminal
    command="firma delete txn 86"
    rows={[
      { type: 'val',  label: '◆  Delete #86 · TSLA buy 5 @ $351.69 on 2026-04-08?', value: 'Yes' },
      { type: 'beat', text:  'Transaction #86 deleted.' },
    ]}
  />
</Section>
