Giter Site home page Giter Site logo

geldmacher / cake-to-cointracking-converter Goto Github PK

View Code? Open in Web Editor NEW
14.0 6.0 5.0 95 KB

Translates Cake CSV exports to valid CoinTracking CSV imports

License: GNU Affero General Public License v3.0

JavaScript 100.00%
cake cointracking crypto cryptocurrency taxes lapis staking liquidity-mining defi

cake-to-cointracking-converter's Introduction

Cake to CoinTracking Converter

CLI script to translate Cake export data to a valid CoinTracking import.

IMPORTANT: Make a backup of your trades before you import new data via this script!
EVEN MORE IMPORTANT: This is no tax advice! The way this script imports data might be wrong.

Features

  • Supports german and english CoinTracking import
    English is used by default.
  • Displays simple overview of current holdings at cake
    This overview is displayed in the CLI after script execution. You need the export data of your complete Cake usage time. Otherwise this overview is nonsense.
  • Displays simple overview of monthly income at cake.
    This overview is displayed in the CLI after script execution.
  • Uses Cake's FIAT valuation for each transaction in your chosen export currency instead of the CoinTracking valuation data
    Keep in mind that your CoinTracking account currency should match your exported transaction valutation currency from Cake. This feature can be disabled via --use-cointracking-fiat-valuation. The CoinTracking data is than used.
  • Generates trades for Liquidity Mining, Swap and "50% Discount" operations
    In case of Liquidity mining operations this script generates trades from the used assets (eg BTC and DFI) to their corresponding pool tokens (eg BTC-DFI) and vice versa. Even the correct FIAT valuation for the pool tokens is transmitted to CoinTracking.
  • Consolidate data from staking operations on a daily basis at midnight (EXPERIMENTAL)
    This can drastically reduce the import amount of data rows for CoinTracking. You can switch this on via --consolidate-staking-data.
  • Supports DeFiChain DEX swap operations
    DEX swaps are converted to CoinTracking trades with an additional swap fee.

IMPORTANT: The consolidation feature is experimental. Please check your CoinTracking import carefully (and make a backup) and let me know if something is wrong. You cannot switch between the normal mode of this script and this consolidation mode, because the consolidation mode is generating its own Tx-ID's to identify the imported data rows. The only clean solution for switching between these modes would be to delete the complete data set from CoinTracking and reimport if afterwards. Another caveat of the consolidation mode is, that you need to import Cake's data for "complete days". Otherwise some staking data would be lost, because the consolidation mode consolidates all staking data for each day and defines a new Tx-ID for each day. After this a day is "completed" and no further data is added to CoinTracking for this day.

Installation

  1. Node.js is required to run this script. Just download and install the current LTS version.
  2. Install it via npm CLI (Bundled with Node.js):
npm install -g cake-to-cointracking-converter

Usage

  1. Get your Cake transactions export (CSV) for all coins and generate a CoinTracking import via CLI.

  2. Example CLI command (More options below):

cake2ct --cake-csv "path\to\cake-export-file.csv" --ct-csv "path\to\cointracking-import-file.csv" --language "DE"
  1. Import the generated CSV via CoinTracking CSV Import. Just select your file, check your imports on the next page and import your data if everthing is fine.

Options

  • --cake-csv - Path to Cake CSV.
  • --ct-csv - Path to CoinTracking CSV. Creates one, if it is not existing.
  • --language (optional) - Used language for CoinTracking import file. "DE" and "EN" are supported. Default is "EN".
  • --display-holdings-overview (optional) - Displays simple overview of current holdings at cake. You need the export data of your complete Cake usage time. Otherwise this overview is nonsense.
  • --consolidate-staking-data (optional) - Consolidate data from staking operations on a daily basis at midnight.
  • --use-cointracking-fiat-valuation (optional) - Use the FIAT transaction valuation from CoinTracking instead of the valuation data from Cake.
  • --display-income-overview (optional) - Displays simple overview of monthly income at cake.

Supported Cake operations

  • Deposit (incl. DEX deposit)
  • Withdrawal
  • Withdrew for swap
  • Withdrawal fee
  • Paid swap fee
  • Entry staking wallet
  • Exit staking wallet
  • Referral reward
  • Referral signup bonus
  • Entry staking wallet: Signup bonus
  • Entry staking wallet: Referral signup bonus
  • Promotion bonus
  • Entry staking wallet: Promotion bonus
  • Lending reward
  • Lending DFI Bonus
  • Entry staking wallet: Lending DFI Bonus
  • Confectionery Lending DFI Bonus
  • Staking reward
  • 5 years freezer reward
  • 10 years freezer reward
  • Freezer promotion bonus
  • Entry staking wallet: Freezer promotion bonus
  • Freezer staking bonus
  • Freezer liquidity mining bonus
  • Unstake fee
  • Bonus/Airdrop
  • Entry staking wallet: Bonus/Airdrop
  • Add liquidity (d)X(X...)-YYY(Y)
  • Remove liquidity (d)X(X...)-YYY(Y)
  • Added liquidity
  • Removed liquidity
  • Liquidity mining reward (d)X(X...)-YYY(Y)
  • Swapped in
  • Swapped out
  • Claimed for 50% discount
  • Used for 50% discount

Sponsor me

I made it a lot more easy for you to manage your Cake data with CoinTracking? Show me some love! ;D

Your options:
❤️ GitHub Sponsors
❤️ DeFiChain (DFI) Address: df1qynftu7aqh3qm8k004zxp804h00wuzcm5rqv8wa
❤️ Bitcoin (BTC) Address: bc1q04z9xnuf9adac042k44q9v0j4ur7exkr5tp85t
❤️ Ethereum (ETH) Address: 0xAb1c000a139B18a5B3F48cDA0e9eeF57eF842902


Something missing? Open an issue or make a PR! ;D

cake-to-cointracking-converter's People

Contributors

chrsch avatar geldmacher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cake-to-cointracking-converter's Issues

Daily accumulated Rewards

Hey,

thank you for developing such a tool.

It would be nice, if your tool could offer an option to save count of transactions. In my opinion it would be sufficient to accumulate all rewards from one product (staking, Liquidity Mining) on a daily basis.

The screenshot shows the result for 31th Dec. 2020. Green shows staking rewards and blue Liquidity Mining Rewards for that day (of all LM-Pools).

Bildschirmfoto 2021-04-11 um 15 54 28

This could be accumulated to 2 transactions. Otherwise I need to import 356 transcations for just one month, where I did not really a lot at Cake. CoinTracking is limited to 3500 transaction for PRO users and thus I would need to upgrade in 10 months.

So, please add this function. I'd really appreciate this.

Thanks

Some transactions that cannot be processed

First of all, thanks for the good work. The tool worked on my Windows machine like a charm. There were only a few transactions that could not be processed and I had to add them manually to Cointracking...

BTC Cannot Process:
Claimed for 50% discount
Referral reward

DFI Cannot Process:
Referral signup bonus
Signup bonus
Used for 50% discount
Confectionery Lending DFI Bonus

("Claimed and Used for 50% discount," is of course 1 TRADE)

Keep the good work!

Bonus staking rewards not handled

Here is the line. I'll change this manually in my import file for now. Thank you for this tool, saved me a few hours of writing my own. :)

2021-05-03T22:08:04-06:00,Entry staking wallet: Signup bonus,5.06995267,DFI,20,USD,,,7d02bf46-62c3-4307-a40b-a8afcd81e90d,

Unhandled Cake operation and RangeError

Erstmal danke für deine Mühe! Ich habe bereits mit dem Gedanken meinen eigenen CSV converter zu entwickeln.

The issue

image
I got two errors for my DFI csv.

  1. Swapped in is a unhandled operation. Example CSV:
"2020-12-09T19:21:20+01:00","Swapped in","111","DFI","41.96580777774","EUR","","","ffc510c0-3333-3333-be16-c3556ad2e9a2","f2d94b3a-e894-3333-8842-320617e3a1e3"
  1. Error: RangeError: Invalid time value. Seams like a date error stack overflow. Is it possible to add more log information e.g. the row where the error occurs? My csv had 6500 line, but nevertheless I found the line which caused the issue:
"2020-12-09T19:22:12+01:00","Add liquidity ETH-DFI","-111.01240191","DFI","-41.9704965720745660494","EUR","","","996c4c3f-3333-3333-ae42-2933bd4a117e","07790cbb-2fca-3333-8d04-c68b338733306"

8 characters currency ticker limitation on CoinTracking

On CoinTracking it is not possible to assign ticker for currencies with more than 8 characters. That's why the ticker for eg the dARKK-dUSD LM pool token is saved as DARKK-DU.

ATM i don't see any smart optimization for this an would leave it at it is. Any suggestions?

Swaps are not imported correctly

Liegt vermutlich daran, dass swaps aktuell als "unknown" Transaktion in die CSV exportiert werden. Folglich kann Converter damit nicht umgehen.
VG

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.