Converts NovaDAX CSV reports to formats accepted by Koinly.
- Python 3.10 or later
pip3 install --upgrade nd2k
nd2k novadax-file.csv
Alternatively, you can use a container image:
[docker|podman] run -v $(pwd):/wdir -w /wdir ghcr.io/thiagoalessio/nd2k ./novadax.csv
- Each line in the NovaDAX CSV is an Operation.
- Each line in the Koinly CSV is a Transaction.
Transactions can consist of one or more operations.
NonTrade
(a.k.a. "Simple Transaction"), such as deposits and withdraws has only one operation;Swap
has 2 operations (asset_a and asset_b). Swaps have no fees;Exchange
andTrade
have 3 operations: base asset, quote asset and fee;- The only practical difference between them is that in the NovaDAX CSV, trades mention the trading pair explicitly on the operation summary, while exchanges come only with a generic summary ("Convert").
This script organizes NovaDAX CSV operations into transactions, and outputs them as a new CSV that follows the Koinly Universal Format.
In a trading pair like BTC/EUR:
- Base asset (BTC): The asset being bought or sold.
- Quote asset (EUR): The asset used to price the base asset.
The NovaDAX CSV file must be parsed in reverse order (from the last line to the first) to correctly match trades with their corresponding fees.
Trading fee lines do not specify which trade they belong to, so we infer the relationship based on the fee's currency and the trade type (purchase or sale).
- For purchases, the fee is charged in the base asset currency.
- For sales, the fee is charged in the quote asset currency.