steem-cointracking: Generate complete transaction history for STEEM

in #steem6 years ago

Tax season is upon us here in Norway, and with it comes updated guidelines for how to treat cryptocurrencies. Because of that I decided to start using CoinTracking.info, (which I wholeheartedly recommend), to track all of my crypto history. That worked great for BTC and Ethereum wallets and most exchanges, however for STEEM (and Bitshares) it was impossible to get a full printout of my transaction history. I did some research and found the steem-report repo by MidnightLightning, but unfortunately it had been broken by recent changes in the Steem API, and I was unable to get it working properly.

That's why I decided to fork that repo and build my own version. That repo can be found here: steem-cointracking.

Instead of fetching data from an API server I decided to use @furion's amazing SteemData service, which allowed me to fetch all the transaction history for a given account. Once I had the data, it was a matter of parsing the various operation types properly and organizing the data, and then writing the data to a CSV file that can be imported directly into CoinTracking.info.

Usage

To use the script, simply clone the repo locally then run npm install. Once the modules are installed, you can run the script for your desired account:

node app.js myaccount

There are some additional input parameters that are explained in the README.

You'll then find a file in the output folder called myaccount-steem-transactions.csv. This file can then be imported directly into CoinTracking using their Bulk Imports > CSV Import option:

Caveats

After weeks of tweaking I now have a working script that generates a mostly correct history, but there are still some discrepancies in balances and some missing data from the Steem blockchain itself.

I've classified block production as Mining, and Author/Curation rewards as Income. You're free to change this however you like, the same goes for any of the many operation types.

I've also added grouping for many operation types, since STEEM generates an enormous amount of transactions. Most groupings are by day, for example author rewards and curation rewards.

If you see a better way of doing things, please open an issue and let me know.

Early mining

There are issues with the STEEM history for older accounts that participated in the initial mining phase. The producer rewards for that phase are not recorded in the current history, causing missing balances. To compensate for this, I've assigned the difference between the final balance and the actual balance to these early mining operations.

VESTS to STEEM conversion

In order to track the actual value of VESTS, I've added bi-weekly deposits of STEEM that correspond to the current balance of VESTS. This conversion is done using a formula to calculate the steem_per_mvests ratio found here: https://steemit.com/steemdev/@holger80/how-to-estimate-historic-steempermvests-values-for-converting-old-rewards-from-vest-to-steem

I noticed that this formula broke down completely for the early mining phase, so I extracted actual values manually from the blockchain and stored them in a json file. These values were then used to interpolate a better value for early steem_per_mvests ratios.

VESTS inaccuracies

Despite having spent a lot of time debugging the various operations and tracking down many bugs, there are still accounts where the final calculated balances are different from the actual balances. One of my accounts is a good example, witness.svk. This account has a large discrepancy in the final balance of MVESTS, and I've so far been unable to track down why. There may be other inaccuracies as well.

Sort:  

Hi there! I made this gift for you and i hooe you can give it a look and like. Thanks in advance :) https://steemit.com/@soufiani/svk-working-behind-the-scene-the-pencil-version

sketch1529279930226-02.jpeg

what a great information!
tnx sir @svk for ur post.

If only I had the skills you have! Would make life much easier! Thanks for sharing the info. I'm from the Netherlands and my crypto investments are below the threshold for taxation. Nevertheless, it's not a bad idea to start looking into things like CoinTracking.info. Thanks again.

In future tax will be added on steem.

How will they know unless you volunteer to owe

They won't, but if you're not honest about your crypto earnings then it will most likely come back to haunt you once you start spending that income. It can also be expected that tax authorities will improve their tools and knowledge of blockchains as time goes by, which may lead to questions asked of you. My advice is to make sure you have your records in order.

Kanskje jeg skal sjekke ut cointracking.info, har enda ikke forsøkt å omgjøre steem til NOK, er det i det hele tatt sikkert? eller er det fare for å bli svindlet på en måte?

Nice informative post

Loading...

@svk Norway is leading country on steemit and your inputs are always welcome to community.
we will restart extremesports challenge that was supported by you a while back
your input on entire community is great influence for people who believe in steemit

This would have been such a help for me now if Steemdata hadn't been shut down....

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.032
BTC 62276.80
ETH 3005.63
USDT 1.00
SBD 3.62