# `finance@2`: accounts, balances, transactions, budgets and recurring charges

Version **2.3.0** · published 2026-11-29 (2.1.0 and 2.2.0: 2026-11-30; 2.3.0: 2026-12-01) · MIT · boards: monthly-budget, subscriptions, personal-finance, debt-payoff, investment-portfolio (rental-portfolio reads it through the crate library)
· compatible with Count My Stack (`countmystack@1`: same core tables and columns)

One row of `transactions` is one line on a bank or card statement. Connectors (bank CSV with the layout library, OFX/QFX,
QIF; SimpleFIN later, as an optional paid lane-2 source) write accounts, transactions and balances; the finance library
adds recurring series, transfer pairs and categories from rules; boards read it all through `metrics.sql`.

## Conventions
- **Signs:** money in > 0, money out < 0, in the account's currency (`amount`). Debts are negative balances.
- **Base currency:** every column ending in `_base` is the amount in `meta.base_currency` (finance@1 called these
  `*_usd` even when the base was not USD). `expense_base` is spending as a positive number; a refund inside a spending
  category makes it negative, so it reduces that category's spending.
- **Flows:** `flow_type` decides what counts. Only `spend` rows count as spending and only `income` rows as income.
  `transfer` (between the person's own accounts: card payments, savings) and `investment` count as neither.
- **IDs:** `txn_id` is the source's own id when it has one (`ofx:<account_id>:<FITID>`), otherwise the first 12 hex of
  sha1(`account_id|date|description|amount|currency|n`) where `n` counts identical rows on the same day within one file (two coffees are two
  rows). It never depends on row order or import time.
- **Splits:** a source row split across categories is replaced by its parts. Each part has `split_of` = the source
  row's id and its own id `<source id>:<n>`; the parts add up to the source amount.
- **Transfers:** both legs of a transfer share a `transfer_group_id`; a leg with no partner is `transfer_status = unpaired`.
- **Provenance:** `source`, `source_ref`, `imported_at` (left out of `data_hash`) and `confidence` on fact tables.
- Dates `YYYY-MM-DD`; rates and shares are decimals (0.15 = 15%).

## Sources that fill it
| Source | Lane | Fills |
|---|---|---|
| Bank or card CSV (layout library: Chase, Amex, Capital One, Bank of America, Discover, Monzo, Revolut, Wise, N26) | 1 | accounts, transactions; balances when the file has a running balance |
| OFX / QFX ("Download for Quicken") | 1 | transactions with FITID ids, balances from `LEDGERBAL` |
| QIF | 1 | transactions (hash ids) |
| The person or their assistant | 1 | categories budgets, goals, debts, valuations, rules |
| A debts file the person keeps (lender, APR, minimum payment, due day, limit, promo rate) | 1 | debts; a typed balance as `balances` with `basis = manual` |
| Brokerage positions and activity CSVs (generic; Fidelity-, Vanguard-, Schwab-like layouts) and a targets file | 1 | holdings, asset_trades, investment-account transactions, allocation_targets (since 2.2.0) |
| A private investments file and its calls and distributions (capital notices), NAV statements as valuations | 1 | private_investments, private_investment_events, valuations (since 2.3.0) |
| SimpleFIN Bridge (optional, paid, US) | 2 | accounts, transactions, balances (later; never the default) |

## What changed from finance@1 (major)
- `*_usd` columns renamed to `*_base` (meaning: in `meta.base_currency`), `fx_rates.usd_per_unit` to `base_per_unit`,
  `transactions.usd_source` to `fx_source`.
- `transactions.txn_id`, `transactions.flow_type`, `transactions.currency` and `accounts.currency` are required.
- New: provenance columns, `counterparty`, `recurring_id`, `split_of`; tables `recurring`, `recurring_prices`, `debts`;
  `categories.parent`; `goals.note`. `subscriptions` is now a view over `recurring` (Count My Stack compatibility).
- Removed (owner-specific, from one person's private model): `private_investments.registry_canceled_on`, `open_item`,
  `needs_review`; `properties.in_known_assets`, `in_related_rollup`, `in_combined_rollup`, `is_held`, `is_sold`,
  `is_rented` (use `status`); `balances.stale`, `eligible`, `age_months`; `holdings.validation_status`, `eligible`;
  `transactions.base`, `cost_type`, `holding`. A fork that needs them keeps them in `x_<owner>_<table>` tables.
- Migration and codemod: `../migrations/README.md`.

## Debts (since 2.1.0)
- One `debts` row per card or loan, keyed by `account_id`; the balance owed lives in `balances` (negative, like every
  debt) and the money moving in `transactions` (a payment is money in on the debt account, interest and fees money out).
- `apr`, `promo_apr` are decimals (0.2499 = 24.99%); `promo_apr` applies until `promo_end` (inclusive), then `apr`.
  `min_payment` is the monthly minimum in the debt's currency; `due_day` 1..31 (a month without that day uses its last day).
- `credit_limit` (cards and lines) makes utilisation possible; `kind` says what the debt is (vocab `debt_kinds`).
- One source per debt: a debt's balances come from its own statement file or are typed by the person, never both summed.

## Investments (since 2.2.0)
- **Positions** are `holdings` rows: one per account, date and ticker (a ticker held twice in one account on one date,
  e.g. two lots, is one row with the units summed). Value is `units * price` in `currency`; `value_base` only when a
  rate for that currency is in `fx_rates` (with its `source`), else NULL: a holding without a rate is shown in its own
  currency and never summed into a base-currency total. `price_date` is set when the quote is older than `date`.
- **Units moving** (buys, sells, reinvested dividends, splits, shares moved in or out) are `asset_trades` rows with
  `account` = the `account_id`, `side` buy | sell | deposit (shares in) | withdrawal (shares out) | split, and `txn_id`
  pointing at the cash leg when there is one.
- **Money moving** in or out of an investment account is a `transactions` row on that account: a contribution or a
  withdrawal is `flow_type = investment` (category `Contributions` or `Withdrawals`), a dividend or interest is
  `income` (category `Dividends` or `Interest`; reinvested ones too: the reinvestment is a buy), an account fee is `spend`
  (category `Investment fees`). Buys and sells move money inside the account and are not `transactions` rows. So
  growth = value now - value then - contributions + withdrawals, and contributions are never counted as growth.
- **Targets** are the person's own: `allocation_targets` rows for one dimension add up to 1 (`targets_valid`); `band`
  is how far either side of the target the person is fine with. A fund's cost is `holdings.expense_ratio` (decimal);
  an unknown ratio is NULL, never 0.

## Private investments, property costs, taxes, pending rows and receipts (since 2.3.0)
- **Private investments** keep one row in `private_investments` (what it is: `kind` venture_fund | private_equity | direct |
  private_credit | real_estate_lp | other, `manager`, `vintage`, `committed`, `status_note`) and one row per capital call or
  distribution in `private_investment_events` (money in > 0: a call is negative, a distribution positive). When events
  exist, `called` = minus the sum of calls and `distributed` = the sum of distributions (`private_valid`), so paid-in
  multiples have one source: TVPI = (NAV + distributed) / called, DPI = distributed / called, still to be called =
  committed - called. The NAV history is `valuations` with `asset_ref` = `investment_id` (basis `statement` for a
  manager's NAV, `cost` while held at cost); `nav` / `nav_date` are the latest one.
- **Property money** is `transactions` with `property_id`; `property_bucket` says which kind of cost it is: `running`
  (mortgage, tax, insurance, utilities, HOA, management), `maintenance` (repairs, servicing, cleaning) or `improvement`
  (adds to the cost basis). Rent is income on the same property and has no bucket.
- **Taxes** are one row per payment with `type` income | capital_gains | property | wealth | sales | other (vocabulary
  `tax_types`, documented values; free text from older sources still reads), `country`, `jurisdiction`, `status` paid |
  due | estimated (due and estimated rows are upcoming, never counted as paid) and `amount_base`. Property tax paid from a
  bank account may also be a `transactions` row: a `taxes` row that is the same payment carries its `txn_id`, so a
  reader counts it once.
- **Pending** rows (`transactions.status = pending`) are real money the bank has not settled yet; NULL means posted.
- **Receipts:** `transactions.receipt` is 1 when the person has the receipt, 0 when they keep receipts and this one is
  missing, NULL when receipts are not tracked. The document itself never enters the database.
- **Cash dividends and interest** from one holding are `income` rows on the investment account with `asset_id`.
- **Subscriptions** say what they are with `recurring.subtype` (vocab `subscription_types`); `last_used` stays the
  person's own date.

## Compatibility
- A board that declares `finance@2 >=2.0` keeps working on any later 2.x database.
- Remixes that add only metrics, pages and `x_<owner>_` tables survive every minor without a merge conflict.
- finance@1 databases migrate with `../migrations/1-to-2.py`; forked `metrics.sql` files with `../migrations/metrics-codemod.py`.

## Fields

<!-- fields:begin (generated from schema.sql by spec/build.py; edit the DDL comments) -->

### `meta` (required table)

Key/value facts about this database. Required keys: schema, schema_version, as_of, data_hash, source_built_at, base_currency.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `key` | TEXT | **yes** | e.g. as_of, base_currency, household |
| `value` | TEXT | no | text; dates as YYYY-MM-DD |

### `accounts` (required table)

One row per bank, card, loan, brokerage or asset account.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `account_id` | TEXT | **yes** | stable id the person or connector chooses, e.g. checking, visa-4417 |
| `name` | TEXT | **yes** | friendly name shown on boards, e.g. Everyday Checking |
| `institution` | TEXT | no | bank or provider name |
| `group` | TEXT (vocab `account_groups`) | **yes** | Cash \| Investments \| Credit & loans \| Property \| Other assets (vocab account_groups) |
| `currency` | TEXT (currency) | **yes** | ISO 4217 code of the account, e.g. USD (required since 2.0.0) |
| `rate` | REAL | no | interest rate as a decimal: APY for savings, APR for debt |
| `notes` | TEXT | no | free text from the person |
| `last4` | TEXT | no | last four digits only; never a full account number |
| `book` | TEXT | no | personal \| business |
| `owner` | TEXT | no | whose account in a household (a name or initials) |
| `status` | TEXT (vocab `account_status`) | no | open \| closed |
| `opened` | TEXT | no | date the account was opened |
| `closed` | TEXT | no | date the account was closed |
| `first_txn` | TEXT | no | date of the first transaction in this database (derived) |
| `last_txn` | TEXT | no | date of the last transaction in this database (derived) |
| `txn_count` | INTEGER | no | transactions in this database (derived) |
| `source` | TEXT | no | connector that created the account row, e.g. bank-csv, ofx, manual |

### `balances`

Account balances at a date (statement, API or typed by hand). Net Worth reads these.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `date` | TEXT (date) | **yes** | date the balance is true at (statement end, or as-of) |
| `account_id` | TEXT | **yes** | accounts.account_id |
| `balance` | REAL | **yes** | in the account's currency; debts are negative |
| `currency` | TEXT (currency) | no | ISO 4217; defaults to the account's currency |
| `balance_base` | REAL | no | balance in meta.base_currency |
| `basis` | TEXT (vocab `balance_basis`) | no | statement \| api \| manual \| derived (vocab balance_basis) |
| `source` | TEXT | no | connector id, e.g. ofx (LEDGERBAL), bank-csv (running balance column) |
| `source_ref` | TEXT | no | file + line, or the source's own id |
| `imported_at` | TEXT | no | ISO 8601 UTC instant the row was written |

### `transactions` (required table)

One row per transaction. Sign: money in > 0, money out < 0, in the account's currency.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `txn_id` | TEXT | **yes** | the source's id (OFX FITID as ofx:<account>:<fitid>) or sha1(account\|date\|description\|amount\|currency\|n)[:12]; never row order |
| `date` | TEXT (date) | **yes** | posting date (or transaction date when that is all the source has) |
| `account_id` | TEXT | **yes** | accounts.account_id |
| `amount` | REAL | **yes** | signed, in currency: -42.50 is money out |
| `currency` | TEXT (currency) | **yes** | ISO 4217 code of amount (required since 2.0.0) |
| `flow_type` | TEXT (vocab `flow_types`) | **yes** | income \| spend \| transfer \| investment \| other (vocab flow_types; required since 2.0.0) |
| `description` | TEXT | no | as the bank wrote it; never edited |
| `merchant` | TEXT | no | cleaned name, from rules or the source |
| `category` | TEXT | no | categories.category; Uncategorized when no rule matched |
| `subcategory` | TEXT | no | optional finer category |
| `kind` | TEXT | no | Count My Stack's name for flow_type (same value); kept for compatibility |
| `amount_base` | REAL | no | amount in meta.base_currency |
| `income_base` | REAL | **yes** | money in that counts as income, in base currency (0 unless flow_type = income) |
| `expense_base` | REAL | **yes** | spending in base currency, positive (0 unless flow_type = spend; refunds in a spending category make it negative) |
| `fx_source` | TEXT | no | where the base-currency rate came from (fx_rates.source), NULL when currency = base |
| `counterparty` | TEXT | no | the other party when known (payer, payee, the other account's name) |
| `recurring_id` | TEXT | no | recurring.recurring_id when this charge is one of a recurring series |
| `transfer_group_id` | TEXT | no | the same id on both legs of a transfer between own accounts |
| `transfer_status` | TEXT (vocab `transfer_status`) | no | paired \| unpaired \| manual (for flow_type = transfer) |
| `split_of` | TEXT | no | for split rows: the txn_id of the source row they replace; their amounts add up to it |
| `book` | TEXT | no | personal \| business |
| `owner` | TEXT | no | whose spending in a household |
| `property_id` | TEXT | no | properties.property_id for property income and costs (rental@1 reads these) |
| `entity_id` | TEXT | no | entities.entity_id when the money belongs to a company or trust |
| `notes` | TEXT | no | free text from the person |
| `confidence` | TEXT (vocab `confidence`) | no | how the category was set: source \| rule \| default \| detected \| manual \| migrated |
| `rule_source` | TEXT | no | the rule's match text when a rule set the category |
| `source` | TEXT | no | connector id: bank-csv, ofx, qif, simplefin, manual, finance@1-migration |
| `source_ref` | TEXT | no | file:line or the source's own object id |
| `imported_at` | TEXT | no | ISO 8601 UTC instant the row was written |
| `status` | TEXT (vocab `txn_status`) | no | pending \| posted (vocab txn_status; since 2.3.0). NULL = posted; a pending row is real money not yet settled |
| `receipt` | INTEGER | no | 1 = a receipt is on file, 0 = the person keeps receipts and this one is missing, NULL = not tracked (since 2.3.0) |
| `asset_id` | TEXT | no | assets.asset_id when the money comes from one holding: a cash dividend or interest (since 2.3.0) |
| `property_bucket` | TEXT (vocab `property_buckets`) | no | running \| maintenance \| improvement for money spent on a property (vocab property_buckets; since 2.3.0) |

### `categories` (required table)

Categories and their monthly budgets.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `category` | TEXT | **yes** | e.g. Groceries (vocab categories lists a default tree) |
| `type` | TEXT (vocab `flow_types`) | no | spend \| income \| transfer \| investment \| other |
| `monthly_budget` | REAL | no | budget per month in base currency; NULL = no budget |
| `fixed` | INTEGER | no | 1 = a fixed cost (rent, insurance), 0 = flexible |
| `parent` | TEXT | no | parent category for a two-level tree, e.g. Food for Groceries |

### `recurring`

Recurring charges and income found in transactions (or confirmed by the person). One row per series.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `recurring_id` | TEXT | **yes** | stable slug, e.g. netflix |
| `merchant` | TEXT | **yes** | merchant as on transactions |
| `category` | TEXT | no | category of the charges |
| `cadence` | TEXT (vocab `cadences`) | **yes** | weekly \| monthly \| quarterly \| yearly (vocab cadences) |
| `flow_type` | TEXT | no | spend (bills, subscriptions) or income (salary); transfers are never recurring rows |
| `amount_typical` | REAL | no | the latest regular amount, positive, in currency |
| `currency` | TEXT (currency) | no | ISO 4217 |
| `first_seen` | TEXT (date) | no | date of the first charge |
| `last_seen` | TEXT (date) | no | date of the latest charge |
| `next_expected` | TEXT (date) | no | date the next charge is expected |
| `status` | TEXT (vocab `recurring_status`) | no | active \| stopped \| cancelled \| trial (vocab recurring_status) |
| `confidence` | TEXT | no | detected \| rule \| manual |
| `account_id` | TEXT | no | account the charges hit |
| `n_charges` | INTEGER | no | charges seen |
| `n_months` | INTEGER | no | distinct months with a charge |
| `billing_day` | INTEGER | no | usual day of the month (monthly series) |
| `trailing_12m_base` | REAL | no | paid in the 12 months to as_of, base currency |
| `last_used` | TEXT | no | date the person last used it (optional, typed by the person) |
| `source` | TEXT | no | detector or connector id, e.g. finance-lib/recurring |
| `imported_at` | TEXT | no | ISO 8601 UTC instant the row was written |
| `subtype` | TEXT (vocab `subscription_types`) | no | what kind of subscription: streaming \| software \| cloud \| health \| music \| news \| shopping \| other (vocab subscription_types; since 2.3.0) |

### `recurring_prices`

Price history of each recurring series: one row per charge. Price-rise insights read this.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `recurring_id` | TEXT | **yes** | recurring.recurring_id |
| `date` | TEXT (date) | **yes** | charge date |
| `amount` | REAL | **yes** | the charge, positive, in currency |
| `currency` | TEXT | no | ISO 4217 |
| `txn_id` | TEXT | **yes** | transactions.txn_id of the charge |

### `subscriptions` (view)

Count My Stack compatibility: subscriptions as a view of recurring spending series.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `name` | TEXT | no |  |
| `category` | TEXT | no |  |
| `price` | REAL | no |  |
| `billing` | TEXT | no |  |
| `billing_day` | INTEGER | no |  |
| `account_id` | TEXT | no |  |
| `last_used` | TEXT | no |  |
| `subscription_id` | TEXT | no |  |
| `book` | any | no |  |
| `observed_months` | INTEGER | no |  |
| `last_seen` | TEXT | no |  |
| `trailing_12m_base` | REAL | no |  |
| `confidence` | TEXT | no |  |
| `contract_confirmed` | any | no |  |
| `next_charge_date` | TEXT | no |  |
| `cancellation_savings_base` | any | no |  |
| `status` | TEXT | no |  |
| `currency` | TEXT | no |  |

### `debts`

Terms of debts (cards, loans), for payoff planning. Balances live in balances.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `account_id` | TEXT | **yes** | accounts.account_id of the card or loan |
| `apr` | REAL | no | annual rate as a decimal, e.g. 0.2299 |
| `min_payment` | REAL | no | minimum monthly payment in currency |
| `due_day` | INTEGER | no | day of the month the payment is due |
| `promo_apr` | REAL | no | promotional rate as a decimal, if any |
| `promo_end` | TEXT (date) | no | date the promotional rate ends |
| `payoff_strategy` | TEXT | no | avalanche \| snowball \| custom |
| `currency` | TEXT (currency) | no | ISO 4217 |
| `source` | TEXT | no | connector id or manual |
| `kind` | TEXT (vocab `debt_kinds`) | no | card \| loan \| student \| mortgage \| line \| other (vocab debt_kinds; since 2.1.0) |
| `credit_limit` | REAL | no | credit limit of a card or line, in currency (since 2.1.0) |
| `source_ref` | TEXT | no | file + line the terms came from, e.g. data/debts.csv:3 (since 2.1.0) |
| `imported_at` | TEXT | no | ISO 8601 UTC instant the row was written (since 2.1.0) |

### `goals`

Targets the person set, as key/value (Count My Stack shape). Known keys: savings_rate (decimal), savings_monthly (base currency).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `key` | TEXT | **yes** | e.g. savings_rate |
| `value` | REAL | no | the target; decimals for rates |
| `note` | TEXT | no | what the person said, in their words |

### `holdings`

Positions in investment accounts at a date.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `date` | TEXT (date) | **yes** | statement or as-of date |
| `account_id` | TEXT | **yes** | accounts.account_id |
| `ticker` | TEXT | **yes** | symbol, e.g. VTI |
| `name` | TEXT | no | security name |
| `asset_class` | TEXT (vocab `asset_classes`) | no | stocks \| bonds \| cash \| crypto \| real_estate \| other (vocab asset_classes) |
| `units` | REAL | no | quantity held |
| `price` | REAL | no | price per unit in currency |
| `cost_basis` | REAL | no | total cost in currency |
| `expense_ratio` | REAL | no | fund fee as a decimal |
| `holding_id` | TEXT | no | stable id for the position |
| `venue` | TEXT | no | broker or exchange |
| `value_base` | REAL | no | market value in base currency |
| `currency` | TEXT (currency) | no | ISO 4217 of price and cost_basis |
| `book` | TEXT | no | personal \| business |
| `owner` | TEXT | no | whose position |
| `source` | TEXT | no | connector id |
| `source_ref` | TEXT | no | file + line or the source's id |
| `imported_at` | TEXT | no | ISO 8601 UTC instant |
| `region` | TEXT (vocab `regions`) | no | us \| developed \| emerging \| global \| other (vocab regions; since 2.2.0) |
| `price_date` | TEXT (date) | no | date of the price when it differs from date, e.g. a stale quote (since 2.2.0) |

### `allocation_targets`

The person's own target mix: one row per bucket of one dimension, shares of the invested total (since 2.2.0).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `dimension` | TEXT (vocab `target_dimensions`) | **yes** | asset_class \| region \| account (vocab target_dimensions) |
| `bucket` | TEXT | **yes** | e.g. stocks, bonds, cash (asset_classes), us (regions) or an account_id |
| `target_share` | REAL | **yes** | the person's target as a decimal share of the total (0.6 = 60%) |
| `band` | REAL | no | how far either side the person is fine with, as a decimal share (0.05 = 5 points) |
| `note` | TEXT | no | what the person said, in their words |
| `source` | TEXT | no | connector id or manual |
| `source_ref` | TEXT | no | file + line, e.g. data/targets.csv:3 |
| `imported_at` | TEXT | no | ISO 8601 UTC instant |

### `private_investments`

Private holdings (angel deals, funds, notes) that have no market price. Still to be called (unfunded) = committed - called. When private_investment_events rows exist for an investment, called and distributed are their totals; the NAV history is valuations rows with asset_ref = investment_id (basis statement for a manager's NAV).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `name` | TEXT | **yes** | the investment's name |
| `type` | TEXT | no | equity \| safe \| note \| fund \| other (the instrument) |
| `committed` | REAL | no | committed capital in currency |
| `called` | REAL | no | capital called so far (paid in), positive |
| `distributed` | REAL | no | money returned so far, positive |
| `nav` | REAL | no | latest net asset value in currency |
| `nav_date` | TEXT | no | date of the NAV |
| `investment_id` | TEXT | no | stable id |
| `book` | TEXT | no | personal \| business |
| `owner` | TEXT | no | whose investment |
| `currency` | TEXT | no | ISO 4217 |
| `purchase_date` | TEXT | no | date invested |
| `disposed_on` | TEXT | no | date sold or closed |
| `cost_basis_base` | REAL | no | cost in base currency |
| `valuation_base` | REAL | no | latest valuation in base currency |
| `valuation_as_of` | TEXT | no | date of the valuation |
| `valuation_basis` | TEXT | no | cost \| last_priced_round \| nav \| written_off \| other |
| `status` | TEXT | no | held \| disposed \| written_off |
| `proceeds_base` | REAL | no | money received on exit, base currency |
| `written_off_on` | TEXT | no | date written off |
| `kind` | TEXT (vocab `private_kinds`) | no | venture_fund \| private_equity \| direct \| private_credit \| real_estate_lp \| other (vocab private_kinds; since 2.3.0) |
| `manager` | TEXT | no | the fund manager or sponsor ("Direct" for a company held directly) (since 2.3.0) |
| `vintage` | INTEGER | no | year of the first capital call or investment (since 2.3.0) |
| `status_note` | TEXT | no | the manager's words on where it stands, e.g. "Active, investing" (since 2.3.0) |
| `source` | TEXT | no | connector id or manual (since 2.3.0) |
| `source_ref` | TEXT | no | file + line, e.g. data/private.csv:3 (since 2.3.0) |
| `imported_at` | TEXT | no | ISO 8601 UTC instant (since 2.3.0) |

### `private_investment_events`

Capital calls and distributions of private investments, one row per event (since 2.3.0). Money in > 0: a distribution is positive, a capital call negative. The NAV history lives in valuations (asset_ref = investment_id).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `event_id` | TEXT | **yes** | stable id: the source's id or a hash of investment\|date\|kind\|amount\|n |
| `investment_id` | TEXT | **yes** | private_investments.investment_id |
| `date` | TEXT (date) | **yes** | date the money moved |
| `kind` | TEXT (vocab `private_event_kinds`) | **yes** | call \| distribution (vocab private_event_kinds) |
| `amount` | REAL | **yes** | signed, in currency: -20000 is a call paid, 4500 a distribution received |
| `currency` | TEXT (currency) | no | ISO 4217 |
| `amount_base` | REAL | no | amount in meta.base_currency |
| `note` | TEXT | no | the notice's words, e.g. "Call 3 of 4" |
| `source` | TEXT | no | connector id or manual |
| `source_ref` | TEXT | no | file + line |
| `imported_at` | TEXT | no | ISO 8601 UTC instant |

### `properties`

Homes and other real estate. rental@1 links listings here by property_id.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `property_id` | TEXT | **yes** | stable id, e.g. flat-lisbon |
| `name` | TEXT | **yes** | friendly name |
| `use` | TEXT | no | home \| rental \| short_term_rental \| land \| other |
| `bought_date` | TEXT | no | purchase date |
| `purchase_price` | REAL | no | in currency |
| `current_value` | REAL | no | latest estimate in currency |
| `value_date` | TEXT | no | date of current_value |
| `mortgage_balance` | REAL | no | outstanding loan, positive, in currency |
| `mortgage_rate` | REAL | no | decimal |
| `monthly_payment` | REAL | no | mortgage payment per month |
| `monthly_rent` | REAL | no | rent received per month (long-term lets) |
| `lease_start` | TEXT | no | current lease start |
| `lease_end` | TEXT | no | current lease end |
| `sold_date` | TEXT | no | date sold |
| `country` | TEXT | no | ISO 3166-1 alpha-2 |
| `owner` | TEXT | no | whose property in a household |
| `legal_owner` | TEXT | no | the name on the deed (person or entity) |
| `status` | TEXT | no | held \| sold \| rented |
| `book` | TEXT | no | personal \| business |
| `cost_basis_base` | REAL | no | cost in base currency |
| `value_basis` | TEXT | no | appraisal \| estimate \| purchase_price \| other |
| `status_note` | TEXT | no | free text |
| `currency` | TEXT | no | ISO 4217 of the money columns |

### `taxes`

Taxes paid, due or estimated. One row per payment (a year-only source writes one row per year, dated 31 December).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `date` | TEXT | **yes** | date paid (or due, for status due \| estimated) |
| `country` | TEXT | no | ISO 3166-1 alpha-2 |
| `type` | TEXT | no | income \| capital_gains \| property \| wealth \| sales \| other (capital_gains and wealth since 2.3.0) |
| `jurisdiction` | TEXT | no | state, city or authority |
| `amount` | REAL | **yes** | positive = paid, in currency |
| `note` | TEXT | no | free text |
| `property_id` | TEXT | no | properties.property_id for property tax |
| `txn_id` | TEXT | no | transactions.txn_id of the payment |
| `book` | TEXT | no | personal \| business |
| `status` | TEXT | no | paid \| due \| estimated |
| `currency` | TEXT | no | ISO 4217 |
| `amount_base` | REAL | no | amount in meta.base_currency (since 2.3.0) |

### `income_years`

Gross income per tax year (Count My Stack).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `year` | INTEGER | **yes** | tax year |
| `gross_income` | REAL | no | in currency |
| `withheld` | REAL | no | tax withheld |
| `currency` | TEXT | no | ISO 4217 |

### `fx_rates`

Exchange rates to the base currency.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `date` | TEXT | **yes** | rate date |
| `ccy` | TEXT | **yes** | ISO 4217 of the foreign currency |
| `base_per_unit` | REAL | no | units of meta.base_currency for one unit of ccy (finance@1: usd_per_unit) |
| `source` | TEXT | no | where the rate came from |

### `prices`

Month-end prices of listed assets, in base currency.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `date` | TEXT | **yes** | price date |
| `asset` | TEXT | **yes** | assets.asset_id or ticker |
| `price_base` | REAL | no | price in base currency |
| `source` | TEXT | no | where the price came from |

### `prices_daily`

Daily closes of listed assets, in base currency.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `date` | TEXT | **yes** | price date |
| `asset` | TEXT | **yes** | assets.asset_id or ticker |
| `price_base` | REAL | no | close in base currency |
| `source` | TEXT | no | where the price came from |

### `valuations`

Dated valuations of anything without a market price (a house, a car, a private holding).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `asset_ref` | TEXT | **yes** | what is valued: properties.property_id, an account_id or a free id |
| `date` | TEXT | **yes** | valuation date |
| `value` | REAL | no | value in ccy |
| `ccy` | TEXT | no | ISO 4217 |
| `value_base` | REAL | no | value in base currency |
| `basis` | TEXT | no | appraisal \| estimate \| statement \| cost \| other |
| `evidence` | TEXT | no | where the number comes from (a document name, never the document) |
| `source` | TEXT | no | connector id or manual |
| `imported_at` | TEXT | no | ISO 8601 UTC instant |

### `entities`

Companies, trusts and other entities that own money.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `entity_id` | TEXT | **yes** | stable id |
| `name` | TEXT | no | name |
| `kind` | TEXT | no | company \| trust \| partnership \| other |
| `jurisdiction` | TEXT | no | country or state |

### `ownership`

Who owns what share of an asset.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `entity_id` | TEXT | no | entities.entity_id |
| `asset_ref` | TEXT | no | what is owned (property_id, account_id, investment_id) |
| `pct` | REAL | no | share as a decimal |
| `source` | TEXT | no | where the share comes from |
| `confirmed` | INTEGER | no | 1 = confirmed by a document |

### `assets`

Listed assets (coins, stocks, funds, metals).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `asset_id` | TEXT | **yes** | stable id, e.g. btc, vti |
| `symbol` | TEXT | **yes** | ticker or symbol |
| `name` | TEXT | no | full name |
| `asset_class` | TEXT | no | stocks \| bonds \| crypto \| metal \| other |
| `kind` | TEXT | no | etf \| stock \| coin \| fund \| other |
| `aliases` | TEXT | no | JSON list of other symbols |
| `priced_as` | TEXT | no | asset_id whose price this asset uses |

### `asset_trades`

Trades and flows of listed assets as the source recorded them.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `trade_id` | TEXT | **yes** | the source's id or a hash of the natural key |
| `asset_id` | TEXT | **yes** | assets.asset_id |
| `date` | TEXT | no | trade date |
| `ts` | TEXT | no | ISO 8601 UTC instant when known |
| `venue` | TEXT | no | broker or exchange |
| `account` | TEXT | no | account at the venue |
| `side` | TEXT | **yes** | buy \| sell \| deposit \| withdrawal \| reward \| fee \| split (shares added; since 2.2.0) |
| `quantity` | REAL | **yes** | units, positive |
| `fill_price_base` | REAL | no | actual fill price in base currency, only when the source has one |
| `fill_source` | TEXT | no | where the fill came from |
| `cash_base` | REAL | no | cash moved, base currency |
| `mark_price_base` | REAL | no | market close that day, never used as a fill |
| `mark_source` | TEXT | no | where the mark came from |
| `fee_qty` | REAL | no | fee in units of fee_asset |
| `fee_base` | REAL | no | fee in base currency |
| `fee_asset` | TEXT | no | asset the fee was paid in |
| `quote_asset` | TEXT | no | quote currency or asset of the pair |
| `pair` | TEXT | no | e.g. BTC-USD |
| `txn_id` | TEXT | no | transactions.txn_id of the cash leg |
| `source` | TEXT | no | connector id |
| `notes` | TEXT | no | free text |

### `asset_snapshots`

Point-in-time quantity and value of listed assets from statements.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `asset_id` | TEXT | **yes** | assets.asset_id |
| `date` | TEXT | **yes** | statement date |
| `venue` | TEXT | **yes** | broker, exchange or wallet provider |
| `account` | TEXT | **yes** | account at the venue |
| `wallet` | TEXT | **yes** | wallet label (never a private key or seed) |
| `quantity` | REAL | no | units held |
| `price_base` | REAL | no | price in base currency |
| `value_base` | REAL | no | value in base currency |
| `price_source` | TEXT | no | where the price came from |
| `source` | TEXT | no | connector id |
| `is_current` | INTEGER | **yes** | 1 = the latest snapshot for this asset, venue and account |

### `txn_id_aliases`

Earlier ids of a transaction (an id scheme change across releases), so notes and corrections that cite an old id still find the row. Written by the importer; readers resolve old ids through it.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `old_id` | TEXT | **yes** | an id the row had under an earlier scheme |
| `new_id` | TEXT | **yes** | transactions.txn_id now (for a split row: its split_of, the source id) |
| `scheme` | TEXT | no | the scheme that made old_id, e.g. finance@1 (account\|date\|description\|amount\|n, one counter) |

### `import_issues`

What the importer could not read or chose to leave out, so a board can show it (never guessed).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `issue_id` | TEXT | **yes** | stable id: <file>:<line> or <file>:<kind> |
| `severity` | TEXT (vocab `severities`) | **yes** | info \| warn \| error |
| `kind` | TEXT | **yes** | skipped_row \| ignored_rows \| unknown_layout \| fx_missing \| unpaired_transfer |
| `file` | TEXT | no | the source file name (never its contents) |
| `line` | INTEGER | no | 1-based line in that file, when the issue is one row |
| `detail` | TEXT | **yes** | what happened, e.g. "the amount is not a number" |
| `handling` | TEXT | **yes** | what the importer did: skipped the row, ignored pending rows ... |
| `source` | TEXT | no | connector id |

### `overrides`

Corrections the person made to imported values, with the reason (platform table).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `override_id` | TEXT | **yes** | stable id |
| `target` | TEXT | **yes** | table.key.column the override applies to |
| `field` | TEXT | no | column name |
| `old_value` | TEXT | no | value before |
| `new_value` | TEXT | no | value after |
| `reason` | TEXT | **yes** | why, in the person's words |
| `evidence` | TEXT | no | where it comes from |
| `author` | TEXT | no | person or assistant |
| `created_at` | TEXT | no | ISO 8601 instant |

### `annotations`

Notes on metrics and pages (platform table). Numbers only through {{metric:...}} placeholders.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `annotation_id` | TEXT | **yes** | stable id |
| `target` | TEXT | **yes** | metric id or page id |
| `kind` | TEXT | **yes** | note \| caveat \| flag \| decision \| open_item |
| `body` | TEXT | **yes** | the note text |
| `author` | TEXT | no | person or assistant |
| `source_ref` | TEXT | no | where it came from |
| `created_at` | TEXT | no | ISO 8601 instant |
| `data_hash` | TEXT | no | hash of the cited metric values when written (stale when they change) |
| `status` | TEXT | no | active \| stale \| retired |

### `metric_registry`

The board's metrics, installed from metrics.sql by the importer (platform table).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `metric_id` | TEXT | **yes** | e.g. budget.month |
| `version` | INTEGER | no | the metric's own version |
| `unit` | TEXT | no | usd \| rows \| pct \| date \| count ... |
| `params` | TEXT | no | comma list of parameters it honours |
| `description` | TEXT | no | the @desc line |
| `sql` | TEXT | no | expanded SQL |
| `test` | TEXT | no | the @test line (check that covers it) |

<!-- fields:end -->

## Vocabularies
| File | Controls |
|---|---|
| `vocab/flow_types.csv` | `transactions.flow_type`, `categories.type` |
| `vocab/account_groups.csv` | `accounts.group` |
| `vocab/account_status.csv` | `accounts.status` |
| `vocab/balance_basis.csv` | `balances.basis` |
| `vocab/transfer_status.csv` | `transactions.transfer_status` |
| `vocab/confidence.csv` | `transactions.confidence` |
| `vocab/cadences.csv` | `recurring.cadence` (with typical days between charges) |
| `vocab/recurring_status.csv` | `recurring.status` |
| `vocab/categories.csv` | a default category tree with synonyms, so different banks' words map to one set (not enforced) |

## Conformance checks
See `checks.yaml` (fail: dates, account links, flow amounts, expense sign, recurring links, splits; warn: transfer
pairs net to zero, categories known, provenance, base amounts). `dashremix spec check <db> finance@2` runs them after
the DDL diff, the meta keys and the JSON Schema on rows.
