Skip to main content

IRS-reportable WHFIT tax lot calculator for Fidelity Bitcoin Fund (FBTC) shareholders

Project description

FBTC Tax Grinder

CI Python 3.12 Python 3.13 Python 3.14 PyPI License: MIT

Python CLI to compute WHFIT tax lots and gain/loss for Fidelity Bitcoin Fund (FBTC) shareholders.

Implements Fidelity's official 2025 grantor trust 6-step gain/loss and basis calculation on a per-lot, per-month basis. Ingests data from Fidelity WHFIT PDFs and ETrade trade CSVs, then exports IRS-reportable results.

Why?

FBTC is structured as a grantor trust, which means shareholders are taxed directly on the trust's Bitcoin activity — not just on share sales. Fidelity publishes a WHFIT tax reporting statement each year with daily BTC-per-share data and monthly expense figures, but they don't compute per-lot results for you. This tool does that: it takes your trade history and Fidelity's published data, then calculates the gain/loss and expense figures you need for your tax return.

Quick start

pip3 install -e ".[dev]"

fbtc-taxgrinder --project ./my-taxes import-proceeds --url <fidelity-whfit-pdf-url>
fbtc-taxgrinder --project ./my-taxes import-trades --file etrade-trades.csv
fbtc-taxgrinder --project ./my-taxes compute --year 2025
fbtc-taxgrinder --project ./my-taxes export --year 2025

Output lands in ./my-taxes/output/ as three CSVs (monthly breakdown, dispositions, and annual summary).

Installation

Requires Python 3.12+.

python3 -m venv venv
source venv/bin/activate
pip3 install -e ".[dev]"

Usage

All commands require --project PATH to specify the project directory. This directory holds all imported data, computed results, and exported CSVs.

1. Import Fidelity gross proceeds data

From a local PDF:

fbtc-taxgrinder --project ./my-taxes import-proceeds --file path/to/fidelity-whfit-2025.pdf

From a URL:

fbtc-taxgrinder --project ./my-taxes import-proceeds --url <pdf-url>

Fidelity publishes WHFIT annual statements for each tax year:

Tax Year PDF
2024 FBTC WHFIT Annual Statement 2024
2025 FBTC WHFIT Annual Statement 2025

2. Import trades from ETrade

fbtc-taxgrinder --project ./my-taxes import-trades --file path/to/etrade-trades.csv

3. Compute tax lots

fbtc-taxgrinder --project ./my-taxes compute --year 2025

Use --force to recompute if results already exist. Two mutually exclusive flags control how buy and sell months are handled:

  • --full-month (default) — uses full-month granularity for buy and sell months, matching Fidelity's 1099 values.
  • --prorate — prorates buy and sell months by actual days held, as described in the WHFIT tax reporting document example.

4. Export results

fbtc-taxgrinder --project ./my-taxes export --year 2025

Generates three CSV files in <project>/output/:

File Contents
2025_monthly.csv Monthly breakdown per lot (days held, expenses, gains)
2025_dispositions.csv Individual sell transactions with gain/loss
2025_summary.csv Annual totals

Other commands

fbtc-taxgrinder --project ./my-taxes lots      # List all lots and sell events
fbtc-taxgrinder --project ./my-taxes status    # Show import/compute status

How it works

Fidelity PDF ──> import-proceeds ──> JSON state ──> compute ──> export ──> CSVs
ETrade CSV ───> import-trades ────────┘

The tool follows Fidelity's 6-step WHFIT calculation for each lot in each month:

  1. Identify BTC ownership — adjusted BTC per share after prior sales
  2. Calculate BTC sold — prorated by days held in the month
  3. Cost basis — portion of adjusted basis attributable to BTC sold
  4. Investment expense — prorated monthly USD proceeds per share
  5. Gain/Loss — expense minus cost basis
  6. Update state — carry forward adjusted BTC and basis to the next period

Year-end states chain into the following year, enabling multi-year tracking.

Note on holding period calculation

Fidelity's WHFIT tax reporting document shows an example where buy and sell months are prorated by actual days held (e.g., 21 out of 30 days for a purchase on 9/9, or phase-splitting around a mid-month sell). However, comparing against actual 1099 values shows that Fidelity uses full-month granularity: shares held at month-end get the full month's expense regardless of buy date, and shares sold before month-end get zero expense for that month.

This tool defaults to full-month granularity (--full-month) to match the 1099. The --prorate flag is available to use the documented proration method instead.

Known limitations

Penny-level rounding discrepancy: This tool maintains full decimal precision throughout all calculation steps and rounds to cents only at CSV export time. Fidelity's published WHFIT example shows a total reportable gain of -$8.65, but neither full-precision-then-round nor intermediate rounding exactly reproduces that figure. The exact internal rounding strategy Fidelity uses cannot be determined from published data. As a result, computed values may differ from Fidelity's by 1-2 cents on individual line items.

Development

# Run all tests
pytest

# Run tests with coverage (must be >= 90%)
pytest --cov=fbtc_taxgrinder --cov-report=term-missing --cov-fail-under=90

# Run a single test
pytest tests/test_compute.py::test_name -v

License

MIT

Disclaimer

This tool is provided for informational and educational purposes only. It is not financial, tax, or legal advice. The authors make no guarantees about the accuracy or completeness of the calculations. Tax laws are complex and subject to change — consult a qualified tax professional before making any decisions based on this tool's output. Use at your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fbtc_taxgrinder-1.0.1.tar.gz (37.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fbtc_taxgrinder-1.0.1-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file fbtc_taxgrinder-1.0.1.tar.gz.

File metadata

  • Download URL: fbtc_taxgrinder-1.0.1.tar.gz
  • Upload date:
  • Size: 37.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fbtc_taxgrinder-1.0.1.tar.gz
Algorithm Hash digest
SHA256 13854d16ac7a8ec65208d0e1d1ca1bc8138a8ff85f631d272ca1156be13600bc
MD5 1504737d033d10eb912008ae0b7d50a3
BLAKE2b-256 1946cc86635d5a9bc0b9bdb96f35119f0679d677cd8cf02bb41c0d685fa19077

See more details on using hashes here.

Provenance

The following attestation bundles were made for fbtc_taxgrinder-1.0.1.tar.gz:

Publisher: publish.yml on schonai/fbtc-tax-grinder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fbtc_taxgrinder-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fbtc_taxgrinder-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ce53ad0eb2325575fc97b3540b7680a81320efa16228efabebdc868d76eed77
MD5 1e443293e951166ce798dd3fd3276194
BLAKE2b-256 2f3b2a3763d1494a1cad07c715db65cbe7fa8929f9b7988df48f4237bc13c879

See more details on using hashes here.

Provenance

The following attestation bundles were made for fbtc_taxgrinder-1.0.1-py3-none-any.whl:

Publisher: publish.yml on schonai/fbtc-tax-grinder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page