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

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@schererf·
0.000 HBD
Tutorial: Get the value of your steemit earnings, Part #3 - Convert to BTC and EUR
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

https://i.imgur.com/3XgIYOr.jpg

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

http://i.imgur.com/J0VuhLa.jpg

# 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
````
<br>

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

https://i.imgur.com/l93SCAN.jpg

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);
});
````
<br>
https://i.imgur.com/9ijGOhS.jpg

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

https://i.imgur.com/5RQ5jaS.jpg

# 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
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,