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

pip install fbtc-taxgrinder

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+.

pip install fbtc-taxgrinder

For development:

git clone https://github.com/schonai/fbtc-tax-grinder.git
cd fbtc-tax-grinder
python3 -m venv venv
source venv/bin/activate
pip 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.2.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.2-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fbtc_taxgrinder-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 951e4674597ffc3a49d3222a70d2004cbbf6ff34d50a52557eccf1c53bd965c5
MD5 17c67a65eef365b0651043913e2b07f8
BLAKE2b-256 b4c4f16811cf5ae41dc19c5c5383fbaf5a52d0f9bc18460ded104ce52b31e5a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for fbtc_taxgrinder-1.0.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fbtc_taxgrinder-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a9f64a401f1c14cf6a9fa55c75e584a36f134c8f63ee7b3fa3bb3f45e5fd738a
MD5 1a12b1eff99397fbad41a08ab664c004
BLAKE2b-256 a05aae57bd44e6b83f94c624d2c01f1bc268f4de68de05e25f217e6215b7b9ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for fbtc_taxgrinder-1.0.2-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