Tutorial: Get the value of your steemit earnings, Part #3 - Convert to BTC and EUR

in #steemdev7 years ago (edited)

Converting your earned SBD, STEEM and SP to BTC and EUR using the historical daily exchange is the topic of the third post of the "get the value of your steemit earnings" series.

The Mission

The requirements for the this series are:

  1. Get the steemit earnings (STEEM, SBD, VESTS) for an account, Create a HTML and CSV report
  2. Calculate the Steem Power (SP) of the VESTS reward
  3. Convert STEEM, SBD and SP values to BTC and EUR using the historical daily exchange rate

You can find the first and second part here:

https://steemit.com/steemdev/@schererf/tutorial-get-the-value-of-your-steemit-earnings-part-1 https://steemit.com/steemdev/@schererf/tutorial-get-the-value-of-your-steemit-earnings-part-2

System Requirements

nodeJS

As the runtime system for the program I used "nodeJS" (LTS version).
You can download nodeJS here: https://nodejs.org

Implementation

git repository

You can download the complete sources of this tutorial from my GitHub repository:
https://github.com/SchererF/steemit-earnings

conversion to BTC and EUR

The conversion itself is somehow easy because you only need the matching exchange rate and multiply the origin value with it:

reward_sbd * exchange_rate_SBD_BTC


The greater challenge was to find a service to get the historical exchange rates from. After some research I decided to take the figures from cryptocompare (https://www.cryptocompare.com/).

You can request data directly by using the right URL with some parameter:
https://min-api.cryptocompare.com/data/histoday?fsym=SBD&tsym=BTC&limit=1

To simplify the usage of this service in nodeJS you can use the appropriate package:
https://www.npmjs.com/package/cryptocompare-api

global.fetch = require('node-fetch');

require('cryptocompare-api').getHistoricalDays({
    limit: 1,
    aggregate: 1,
    fsym: 'SBD',
    tsym: 'BTC'
}).then(data => {
    console.log(data);
});



Let's do it

Please have a look at the first post of this series if you want to know how to download, install and run this program.
https://steemit.com/steemdev/@schererf/tutorial-get-the-value-of-your-steemit-earnings-part-1

Take a look at the output HTML

The created HTML now includes the values for

  • STEEM/BTC, STEEM BTC, BTC/EUR, STEEM EUR
  • SBD/BTC, SBD BTC, BTC/EUR, SBD EUR
  • SP/BTC, SP BTC, BTC/EUR, SP EUR

Note:

  • For the conversion I always used the close value of the day.
  • To get an exchange rate for the Steem Power SP I used the regarding STEEM exchange rate.

Tutorial Preview

First of all I want to move this tool to utopian.io, but still have to do some research on how to do it.

To use this tool even by nodeJS unexperienced users I plan to write another post that shows a complete step by step tutorial from installation to execution.

If have some interesting features or some change requests for this tool please write me a comment. If possible I will include this feature requests to this tool.

Note

This tool can simply be used for your personal interests or of course to create a template for reporting your steemit earnings for a financial office (as we need it in Germany for the tax office).

The created report is of course not an official document. It is just an idea on how to report your earnings!

Please give me feedback if this tutorial was helpful for you.

Thanks for reading and watching,
@schererf

Sort:  


Was noch cool wäre, ein Post über Cashout... Wie macht Ihr das im Fall der Fälle ?Es gibt ja viele Möglichkeiten, würde mich sehr interessieren.TOP TOP TOP ! Genau die Tutorials die ich gesucht habe... Irgendwann muss man sich ja mit dem Finanzamt beschäftigen. UPVOTE @schererf

Der Claim muss als "Einnahme" in der Einkommensteuer versteuert werden.

Bei einem Cashout der STEEM/SBD muss man ja erst in BTC umwandeln. Immer wenn man Crypto-Währungen tradet, muss man den entsprechenden tagesaktuellen EURO Wert ermitteln. Ergeben sich dabei Gewinne oder Verluste, so müssen diese ebenfalls in der Steuererklärung angegeben werden (Währungsspekulation). Weil es damit noch nicht kompliziert genug ist, muss man bei der Wertermittlung immer nach dem FIFO Prinzip vorgehen...

Ich denke die meisten machen Ihre Dokumentation per Excel-Tabelle oder mit Tools wie https://cointracking.info/

Danke !

Puh, da muss ich mir Ende des Jahres aber so richtig Zeit für nehmen... Switche teilweise meine SBD in Steempower und teilweise in Bitshares um. Was mich total interessieren würde, wie hebst du ab bzw. tauscht du crypto? Falls du es überhaupt machst... ✌️

Ich tausche über die gängigen Exchanges wie Poloniex, Bittrex, etc.
Wenn ich mir etwas als Euro auszahlen lassen will, mache ich das über bitcoin.de. Die akzeptieren aktuell BTC, BCH, ETH und BTG.

Wow! Absolutely amazing work @schererf - exactly what I was looking for! You're the best :-)

I just tried it out and I was able to create a html and csv file, although I got some warnings during installation:

Running post install.js
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

I'm on Mac OSX 10.11.6 and installed Node 8.9.4 LTE.

Is there a reason, that the Euro values are not included in the csv file?

It would also be awesome to know, from which user I got the transfers or sent them to. So I'd be able to see, if it's a payout (to an exchange) or a gift to another user.

I'm also asking myself, if there is a chance to see, if I made a trade on the internal market.

Many Thanks (I think I'm blushing now) :-D

I have no MAC so I can't test it on OS-X, but if it works the warnings should be no matter.

Why the Euro values are missing in the csv? Quite simple, I forgot that ;-)
I will fix that as soon as possible.

To show the user besides the transfer is a good idea. I will add this too!

I've also considered to create one file for each year. Do you think that would be useful, or would it be better to leave all values in a single file?

Well deserved, buddy ;-)

Even more important than the Euro values in the csv-file would be the converted SP values (from Vests in Steem).

One file for each year would be awesome, too. Maybe you could even implement the possibilty to choose a date range? That would make it even better :-)

Thanks again for you valuable work, which I appreciate very much! Keep it up!

I'm still working on it. I think I will release a new version near the end of this week :-)

Amazing! Looking forward to it :-)

why not sell for EUR directly? Ill wait till thats possible

Thanks for your comment, but exactly do you mean with "sell for EUR directly"?

I mean sell steem for EUR directly without having to go through bitcoin

Yes that would be a great feature and also should give STEEM a major boost as a currency!

I agree. Right now steem is dancing to bitcoin's whistle. It's like a bad parent not supporting its child to grow causing it to feel down whenever it has a bad day

bitcoin-bitch.gif

Now that's amazing work you have come up with again hat's off :D

Thanks a lot! Do you plan to use the tool and If yes, are there missing features ?

Well done, awesome work @schererf!

Thank you very much!

This post received a upvote from @resteemme and it's trail. Thanks to @resteemme!