Skip to main content

Converts NovaDAX CSV reports to formats accepted by Koinly.

Project description

nd2k

Converts NovaDAX CSV reports to formats accepted by Koinly.

PyPI version PyPI - Downloads
CI Release CodeQL
Codacy Badge Codacy Coverage Badge

Requirements

  • Python 3.10 or later

Installation and Usage

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

Key concepts

Operations and Transactions

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

Types of Transaction

  • 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 and Trade 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.

Base and Quote assets

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.

Implementation details

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.

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

nd2k-0.9.2.tar.gz (42.3 kB view details)

Uploaded Source

Built Distribution

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

nd2k-0.9.2-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file nd2k-0.9.2.tar.gz.

File metadata

  • Download URL: nd2k-0.9.2.tar.gz
  • Upload date:
  • Size: 42.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for nd2k-0.9.2.tar.gz
Algorithm Hash digest
SHA256 8716bd3d7c8fa978c2a5d0724d68d949ac5974e98ff4c1f66dd938a6c86d1a0d
MD5 c5c99e14a3a9916ffe6909805375aba3
BLAKE2b-256 236aa0a0eab6606b5c81ca31548f2476e08940f2adcaf40d5548cfa88d0da42f

See more details on using hashes here.

File details

Details for the file nd2k-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: nd2k-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for nd2k-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7c0bb39dd5c7a47a7b8bc697b3f0cfb633b11bbacc5870ca2a70a5207d876451
MD5 76b67e408de5825a9fa05dd4df34a9b8
BLAKE2b-256 d132d761d9399531df91345fde9afc3a25f7b535b471a6ba5eb7f1381883d187

See more details on using hashes here.

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