IRS-reportable WHFIT tax lot calculator for Fidelity Bitcoin Fund (FBTC) shareholders
Project description
FBTC Tax Grinder
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 | |
|---|---|
| 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:
- Identify BTC ownership — adjusted BTC per share after prior sales
- Calculate BTC sold — prorated by days held in the month
- Cost basis — portion of adjusted basis attributable to BTC sold
- Investment expense — prorated monthly USD proceeds per share
- Gain/Loss — expense minus cost basis
- 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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
951e4674597ffc3a49d3222a70d2004cbbf6ff34d50a52557eccf1c53bd965c5
|
|
| MD5 |
17c67a65eef365b0651043913e2b07f8
|
|
| BLAKE2b-256 |
b4c4f16811cf5ae41dc19c5c5383fbaf5a52d0f9bc18460ded104ce52b31e5a5
|
Provenance
The following attestation bundles were made for fbtc_taxgrinder-1.0.2.tar.gz:
Publisher:
publish.yml on schonai/fbtc-tax-grinder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fbtc_taxgrinder-1.0.2.tar.gz -
Subject digest:
951e4674597ffc3a49d3222a70d2004cbbf6ff34d50a52557eccf1c53bd965c5 - Sigstore transparency entry: 1208975775
- Sigstore integration time:
-
Permalink:
schonai/fbtc-tax-grinder@c646cce095a38ed9044987715f3737931e1febfb -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/schonai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c646cce095a38ed9044987715f3737931e1febfb -
Trigger Event:
release
-
Statement type:
File details
Details for the file fbtc_taxgrinder-1.0.2-py3-none-any.whl.
File metadata
- Download URL: fbtc_taxgrinder-1.0.2-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9f64a401f1c14cf6a9fa55c75e584a36f134c8f63ee7b3fa3bb3f45e5fd738a
|
|
| MD5 |
1a12b1eff99397fbad41a08ab664c004
|
|
| BLAKE2b-256 |
a05aae57bd44e6b83f94c624d2c01f1bc268f4de68de05e25f217e6215b7b9ec
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fbtc_taxgrinder-1.0.2-py3-none-any.whl -
Subject digest:
a9f64a401f1c14cf6a9fa55c75e584a36f134c8f63ee7b3fa3bb3f45e5fd738a - Sigstore transparency entry: 1208975855
- Sigstore integration time:
-
Permalink:
schonai/fbtc-tax-grinder@c646cce095a38ed9044987715f3737931e1febfb -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/schonai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c646cce095a38ed9044987715f3737931e1febfb -
Trigger Event:
release
-
Statement type: