create account

Publish0x: ETH Tipping Data Visualization (20/80) by tomoyan

View this thread on: hive.blogpeakd.comecency.com
· @tomoyan ·
$1.94
Publish0x: ETH Tipping Data Visualization (20/80)
![plotting_data_in_python_matplotlib_vs_plotly.png](https://images.ecency.com/DQmRipePLpJHihNGYQJ5fun6jgRBx6h5Rh1oMqpEGM19FBB/plotting_data_in_python_matplotlib_vs_plotly.png)

[source](https://images.app.goo.gl/vHncZUx7KkSafNVj9)
On [publish0x](https://www.publish0x.com/tomoyan/blurt-whales-making-big-waves-xdrlqqw?a=4zbqpvkapr) platform, you can change tipping % so I am going to do 3 visualization.

* **20% to author / 80% to me**
* **50% to author / 50% to me**
* **80% to author / 20% to me**

to see how **ETH** tipping value is going to be affected. 
(also **BAT** and **LRC** tokens)

![1.png](https://images.ecency.com/DQmbcPb5xVhTsfcVj3D4n2uaCgBxMMoRh7kGnZ3oWPVSyuk/1.png)
This time I have done, **20% to author / 80% to me** for 1 week and see what happened.
Here is the data I have collected and it looks like this πŸ‘‡
```
# 20/80
tipping_data = {
    '1': {
        'eth': [0.00002799, 0.00002823, 0.00002823],
        'bat': [0.0828, 0.0409],
        'lrc': [0.0404, 0.0408]
    },
    '2': {
        'eth': [0.00002773],
        'bat': [0.0728, 0.0182, 0.0177],
        'lrc': [0.0685, 0.0342, 0.0334]
    },
    '3': {
        'eth': [0.00002970, 0.00003022],
        'bat': [0.0349, 0.0186],
        'lrc': [0.1534, 0.0383, 0.0383]
    },
    '4': {
        'eth': [0.00011660, 0.00005830, 0.00002915, 0.00002915, 0.00002929],
        'bat': [0.0, 0.0],
        'lrc': [0.0326, 0.0326]
    },
    '5': {
        'eth': [0.00005899, 0.00002950, 0.00002957],
        'bat': [0.0654, 0.0158, 0.0158],
        'lrc': [0.0344]
    },
    '6': {
        'eth': [0.00011296, 0.00005648, 0.00002824, 0.00002844],
        'bat': [0.0166],
        'lrc': [0.0347, 0.0347]
    },
    '7': {
        'eth': [0.00003037, 0.00012029, 0.00006015],
        'bat': [0.0191, 0.0191],
        'lrc': [0.0332, 0.0340]
    },
}
```

I am going to take this data and feed the data into python plotly script that I made the other day.
Looks like this πŸ‘‡
![2.png](https://images.ecency.com/DQmPs2nY62BXwr3X6Yka3qdA2Cnqy25T63wvMBcC28SDxVy/2.png)

and you can see the graph [here](https://floating-meadow-28045.herokuapp.com/chart-20-80).
https://floating-meadow-28045.herokuapp.com/chart-20-80
https://tomoyan.github.io/chart-20-80

Tipping earning avg is about **~$0.10** a day. 
I think the average 20/80 tip earning  used to be like $0.08 so it seems like they did really increased the reward %. (or it could be the **ETH** price)

1 week Average: $0.093
**ETH** Average: $0.054
**BAT** Average: $0.021
**LRC** Average: $0.018
(exchange price is done by using coingecko API)

It is nice to see that they are giving more **ETH** > **BAT** or **LRC**.

Next week I am going to do 50/50 and see how this is going to change πŸ˜‰ 

My Script πŸ‘‡
```
from tip_data import tipping_data
import plotly.graph_objects as go
import requests
import statistics


def get_price(id):
    # Call coingecko API to get usd price
    base_url = 'https://api.coingecko.com/api/v3/simple/price'
    eth_url = '?ids=ethereum&vs_currencies=usd'
    bat_url = '?ids=basic-attention-token&vs_currencies=usd'
    lrc_url = '?ids=loopring&vs_currencies=usd'

    if id == 'ethereum':
        try:
            r = requests.get(base_url + eth_url, timeout=3)
            r.raise_for_status()
        except Exception as err:
            print("Exception Error:", err)
            return 0.0
    elif id == 'basic-attention-token':
        try:
            r = requests.get(base_url + bat_url, timeout=3)
            r.raise_for_status()
        except Exception as err:
            print("Exception Error:", err)
            return 0.0
    elif id == 'loopring':
        try:
            r = requests.get(base_url + lrc_url, timeout=3)
            r.raise_for_status()
        except Exception as err:
            print("Exception Error:", err)
            return 0.0
    else:
        return 0.0

    return r.json()[id]['usd']


def main():
    eth_price = get_price('ethereum')
    bat_price = get_price('basic-attention-token')
    lrc_price = get_price('loopring')

    eth_amount = 0.0
    bat_amout = 0.0
    lrc_amount = 0.0
    days = []
    eth_data = []
    bat_data = []
    lrc_data = []
    total_data = []

    for key in tipping_data:
        eth_amount = f"{sum(tipping_data[key]['eth']) * eth_price:.3f}"
        bat_amout = f"{sum(tipping_data[key]['bat']) * bat_price:.3f}"
        lrc_amount = f"{sum(tipping_data[key]['lrc']) * lrc_price:.3f}"

        days.append('Data ' + key)
        eth_data.append(eth_amount)
        bat_data.append(bat_amout)
        lrc_data.append(lrc_amount)
        tip_total = float(eth_amount) + float(bat_amout) + float(lrc_amount)
        total_data.append(tip_total)

    avg_total = f"${statistics.mean(total_data):.3f}"
    print(avg_total)

    eth_data = list(map(float, eth_data))
    avg_eth = f"${statistics.mean(eth_data):.3f}"
    print('AVG_ETH: ' + avg_eth)

    bat_data = list(map(float, bat_data))
    avg_bat = f"${statistics.mean(bat_data):.3f}"
    print('AVG_BAT: ' + avg_bat)

    lrc_data = list(map(float, lrc_data))
    avg_lrc = f"${statistics.mean(lrc_data):.3f}"
    print('AVG_LRC: ' + avg_lrc)

    # Daily tipping bar chart
    fig = go.Figure(data=[
        go.Bar(name='BAT', x=days, y=bat_data),
        go.Bar(name='ETH', x=days, y=eth_data),
        go.Bar(name='LRC', x=days, y=lrc_data)],
        layout_title_text=f"""
        Publish0x Tip 20% Author 80% Me Earning Avg: {avg_total}
        """
    )
    fig.update_traces(texttemplate='%{y:.3f}', textposition='outside')

    fig.add_trace(
        go.Scatter(
            name='Tip Total',
            x=days,
            y=total_data
        )
    )

    # Change the bar mode
    fig.update_layout(
        # barmode='stack',
        xaxis_title="Tip Data",
        yaxis_title="$ Amount",
        legend_title="Crypto Tips",
    )
    fig.write_html('chart-20-80.html', auto_open=True)
    fig.show()


if __name__ == '__main__':
    main()

```
<center>
    [Get Rewarded For Browsing! Are you Brave?](https://brave.com/tom490)
    [<img src="https://img.esteem.app/be00j8.png">](https://brave.com/tom490)
    [![happy tears](https://images.ecency.com/DQmUfaVp5UQvASdTyyLrNiBdGB7NxQfxE2wBpNivcDUkCfe/h.gif)](https://tomoyan.github.io/)
    ➑️ [Website](tomoyan.github.io)
    ➑️ [Twitter ](twitter.com/tomoyanTweet)
</center>
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
πŸ‘Ž  
properties (23)
authortomoyan
permlinkpublish0x-eth-tipping-data-visualization-20-80
categorypython
json_metadata{"links":["https://images.app.goo.gl/vHncZUx7KkSafNVj9","https://www.publish0x.com/tomoyan/blurt-whales-making-big-waves-xdrlqqw?a=4zbqpvkapr","https://floating-meadow-28045.herokuapp.com/chart-20-80","https://floating-meadow-28045.herokuapp.com/chart-20-80","https://tomoyan.github.io/chart-20-80","https://api.coingecko.com/api/v3/simple/price","https://brave.com/tom490","https://brave.com/tom490","https://tomoyan.github.io/"],"image":["https://images.ecency.com/DQmRipePLpJHihNGYQJ5fun6jgRBx6h5Rh1oMqpEGM19FBB/plotting_data_in_python_matplotlib_vs_plotly.png","https://images.ecency.com/DQmbcPb5xVhTsfcVj3D4n2uaCgBxMMoRh7kGnZ3oWPVSyuk/1.png","https://images.ecency.com/DQmPs2nY62BXwr3X6Yka3qdA2Cnqy25T63wvMBcC28SDxVy/2.png","https://img.esteem.app/be00j8.png","https://images.ecency.com/DQmUfaVp5UQvASdTyyLrNiBdGB7NxQfxE2wBpNivcDUkCfe/h.gif"],"tags":["python","plotly","visualization","publish0x","eth","mini","marlians","dblog","palnet","neoxian"],"app":"esteem/2.2.7-surfer","format":"markdown+html","community":"esteem.app"}
created2020-08-26 14:01:00
last_update2020-08-26 14:01:00
depth0
children3
last_payout2020-09-02 14:01:00
cashout_time1969-12-31 23:59:59
total_payout_value0.980 HBD
curator_payout_value0.957 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6,334
author_reputation144,440,848,820,221
root_title"Publish0x: ETH Tipping Data Visualization (20/80)"
beneficiaries
0.
accountesteemapp
weight300
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id99,285,775
net_rshares6,111,228,993,393
author_curate_reward""
vote details (49)
@chitty ·
I have picked your post for my daily hive voting initiative, Keep it up and Hive On!!
properties (22)
authorchitty
permlinkre-publish0x-eth-tipping-data-visualization-20-80-20200827t000611
categorypython
json_metadata""
created2020-08-27 00:06:18
last_update2020-08-27 00:06:18
depth1
children0
last_payout2020-09-03 00:06:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length86
author_reputation86,901,300,608,582
root_title"Publish0x: ETH Tipping Data Visualization (20/80)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id99,294,510
net_rshares0
@gitplait ·
Upvoted by GITPLAIT!

We have a curation trial on Hive.vote. you can earn a passive income by delegating to [@gitplait](https://hive.vote/dash.php?i=15&id=1&user=gitplait)
We share 80 % of the curation rewards with the delegators.
___

_To delegate, use the links or adjust_ [10HIVE](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=10%20HP), [20HIVE](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=20%20HP), [50HIVE](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=50%20HP), [100HIVE](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=100%20HP),   [200HIVE](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=200%20HP), [500HIVE](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=500%20HP), [1,000HIVE](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=1000%20HP), [10,000HIVE](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=10000%20HP), [100,000HIVE](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=100000%20HP)

___

Join the [Community](https://hive.blog/trending/hive-103590) and chat with us on [Discord](https://discord.gg/CWCj3rw)  let’s solve problems & build together.
properties (22)
authorgitplait
permlinkqfospm
categorypython
json_metadata{"links":["https://hive.vote/dash.php?i=15&id=1&user=gitplait","https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=10%20HP","https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=20%20HP","https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=50%20HP","https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=100%20HP","https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=200%20HP","https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=500%20HP","https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=1000%20HP","https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=10000%20HP","https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=gitplait&vesting_shares=100000%20HP","https://hive.blog/trending/hive-103590","https://discord.gg/CWCj3rw"],"app":"hiveblog/0.1"}
created2020-08-26 19:56:15
last_update2020-08-26 19:56:15
depth1
children0
last_payout2020-09-02 19:56:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,493
author_reputation911,220,543,569
root_title"Publish0x: ETH Tipping Data Visualization (20/80)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id99,291,180
net_rshares0
@hivebuzz ·
Congratulations @tomoyan! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@tomoyan/comments.png?202008261401"></td><td>You made more than 900 comments. Your next target is to reach 1000 comments.</td></tr>
</table>

<sub>_You can view [your badges on your board](https://hivebuzz.me/@tomoyan) And compare to others on the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Do not miss the last post from @hivebuzz:**
<table><tr><td><a href="/hive-199963/@hivebuzz/meetup-vienna"><img src="https://images.hive.blog/64x128/https://i.imgur.com/UkJTlbu.png"></a></td><td><a href="/hive-199963/@hivebuzz/meetup-vienna">HiveBuzz supports the Austrian Community Meetup</a></td></tr></table>
properties (22)
authorhivebuzz
permlinkhivebuzz-notify-tomoyan-20200826t141723000z
categorypython
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2020-08-26 14:17:21
last_update2020-08-26 14:17:21
depth1
children0
last_payout2020-09-02 14:17:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length926
author_reputation369,211,337,513,501
root_title"Publish0x: ETH Tipping Data Visualization (20/80)"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id99,286,018
net_rshares0