zfin/docs/guides/set-up-accounts.md
Emil Lerch 74fc219afd
All checks were successful
Generic zig build / build (push) Successful in 5m48s
Generic zig build / publish-macos (push) Successful in 11s
Generic zig build / deploy (push) Successful in 23s
add docs/guides
2026-06-22 14:53:53 -07:00

3.7 KiB

Map your accounts

Goal: create an accounts.srf that tags each account with its tax treatment (and, optionally, its institution and maintenance cadence). This unlocks the By Tax Type breakdown, an umbrella-insurance exposure estimate, and broker reconciliation.

You'll need: a portfolio.srf whose lots use account:: labels (build one first). Full field list: accounts.srf reference.

1. List your accounts with a tax type

One record per account. The account:: name must match the account:: value on your lots exactly. The minimum is a tax type:

#!srfv1
account::Pat 401k,tax_type::traditional
account::Pat Roth,tax_type::roth
account::Joint taxable,tax_type::taxable
account::Family HSA,tax_type::hsa

The four recognized tax types are taxable, roth, traditional, and hsa. Run analysis to see the breakdown:

ZFIN_HOME=~/finance zfin analysis
  By Tax Type
  Traditional (Pre-Tax)    █████████████████▋              58.9%  $815,290.06
  Taxable                  ██████▍                         21.6%  $299,010.60
  Roth (Post-Tax)          █████                           16.9%  $233,732.95
  HSA (Triple Tax-Free)    ▊                                2.5%  $35,104.20

Accounts you don't list show up as "Unknown."

2. Add institution and account number (for auditing)

If you plan to reconcile against brokerage exports (audit guide), add the institution and a (placeholder) account number so zfin can match export files to accounts:

account::Pat 401k,tax_type::traditional,institution::fidelity,account_number::P401
account::Joint taxable,tax_type::taxable,institution::schwab,account_number::JT01

Recognized institution keys include fidelity, schwab, vanguard, and wells_fargo.

3. Tune the maintenance cadence

zfin audit (run with no flags) nags you about accounts you haven't refreshed recently. The default cadence is weekly; relax or silence it per account:

account::Family HSA,tax_type::hsa,update_cadence::quarterly
account::Old Rollover,tax_type::traditional,update_cadence::none

4. Advanced flags

Two flags change how analysis treats an account. Both are optional -- see the reference for details:

  • shielded:bool:false -- mark a pre-tax account that is not judgment-protected (deferred comp, a weak-state IRA) so it counts toward your umbrella-insurance exposure -- the slice of net worth a personal umbrella liability policy is meant to cover.
  • cash_is_contribution:bool:true -- treat cash increases on this account as real external contributions in zfin contributions, instead of internal noise.

Example (from examples/pre-retirement-both)

#!srfv1
account::Pat 401k,tax_type::traditional,institution::fidelity,account_number::P401
account::Pat Roth,tax_type::roth,institution::fidelity,account_number::PROTH
account::Sam 401k,tax_type::traditional,institution::vanguard,account_number::S401
account::Joint taxable,tax_type::taxable,institution::schwab,account_number::JT01
account::Family HSA,tax_type::hsa,institution::fidelity,account_number::HSA01

Next steps


Previous: Classify your holdings | Next: Read your portfolio | Documentation home