Convert Domain Money crypto gain/loss statements into the Koinly universal CSV format — so off-chain broker fills still land in your tax pipeline.
Some brokers settle crypto trades off-chain. That means:
- There is no clean on-chain trail for Koinly (or similar tools) to auto-import
- You still get a gain/loss statement with cost basis, proceeds, and dispose dates
- Manual re-entry is painful and error-prone
Crypto_GainLoss_Converter bridges that gap for Domain Money statements: one CSV in, Koinly-shaped trades out.
For every row in the broker export it:
- Parses dates —
Date AcquiredandDate Sold or Disposed(ISO-8601-style timestamps) - Normalizes timezones — treat as UTC, convert to US/Eastern, format for Koinly (
YYYY-MM-DD HH:MM TZ) - Splits each lot into two trades
- Buy on the acquire date (amount = quantity, total = cost basis USD)
- Sell on the dispose date (amount = quantity, total = proceeds USD)
- Builds a Koinly-style frame with pair, side, amount, total, fee columns, and optional IDs
- Writes a new CSV ready for import
Domain Money gain/loss CSV
│
▼
Parse acquire / dispose timestamps
│
▼
Localize UTC → US/Eastern
│
▼
Emit Buy row + Sell row per original lot
│
▼
Koinly universal-format CSV
| Column | Source / value |
|---|---|
Koinly Date |
Acquire or dispose time in US/Eastern |
Pair |
{Property Symbol}-USD |
Side |
Buy or Sell |
Amount |
Property Quantity |
Total |
Cost basis (buy) or proceeds (sell) in USD |
Fee Amount |
0 (default assumption) |
Fee Currency |
USD |
Order ID |
empty (optional) |
Trade ID |
empty (optional) |
These match the original use case and must be true (or the script should be edited):
| Assumption | Why it matters |
|---|---|
| All notionals are USD | Totals and fee currency are hard-coded as USD |
| No explicit fees tracked | Fee amount is set to 0 — spreads may be invisible |
| Domain Money column names match the script | Renamed exports will break parsing |
| Timestamps can be parsed after trimming a fixed suffix | Format is tied to the original statement layout |
If your broker charges fees, uses other quote currencies, or changed their CSV schema, update the mapping before relying on the file for taxes.
Crypto_GainLoss_Converter/
├── dm_statement_convert.py # Domain Money → Koinly converter
├── LICENSE
└── README.md
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install pandas pytz- Export your Domain Money gain/loss statement as CSV.
- Open
dm_statement_convert.pyand set the input/output paths:
df = pd.read_csv("/path/to/Original.csv")
# ...
converted_df.to_csv("/path/to/Revised.csv", index=False)- Run:
python dm_statement_convert.py- Import
Revised.csvinto Koinly using the universal / custom CSV import flow, and spot-check a few lots against the broker PDF/CSV.
The script expects (at least):
Date AcquiredDate Sold or DisposedProperty SymbolProperty QuantityCost Basis (USD)Proceeds (USD)
- Uses older
DataFrame.appendpatterns — fine for small statements; for large files preferpd.concat - Paths are absolute placeholders (
/Users/johndoe/...) — change them before running - No CLI flags yet — a nice upgrade is
argparsefor--input/--output - Fee and multi-currency support would make this more general
This is a personal data-munging utility, not tax advice. Always verify converted trades against broker statements and consult a qualified tax professional for filing decisions.
Distributed under the terms of the GNU General Public License v3.0. See LICENSE for details.
Off-chain broker fills → Koinly-ready CSVs. Built March 2023 with a little help from ChatGPT.