Customize payouts leaderboards stats for STEEM network

in #stats4 years ago (edited)

Hello Steemians,

I believe it exists an elegant solution for the STEEM daily leaderboards statistics. Using @arhag's code and develop branch of steem, I could quickly set up a modified websocket server at ws://62.75.148.124:5090

Then rescanning every block and extract the rewards information.
Hourly/daily/weekly/monthly daily leaderboards statistics should be easy to get, for example:
We know that block number 5694547 has the timestamp: 2016-10-10T00:00:00 UTC.
Steem network has 20 blocks per minute, 20 * 60 = 1200 blocks per hour and 20 * 60 * 24 = 28800 blocks per day (These numbers are not always 100% correct because of network sometimes found block faster than it should and vice versa, but for the sake of simplify we just use these numbers, they are pretty close too).
Then to calculate the daily leaderboards stats for 10-October-2016, we scan from block 5694547 to block 5694547+28800 = 5723347.

My code could be seen at https://github.com/aizensou/steempayouts
It's very short and ugly code, less than 100 lines but it does the work.
To use, just install the dependency first (depends only on websocket)

pip install -r requirements.txt

Usage of the script is simple too:

python steempayouts.py START_BLOCK END_BLOCK X

Where as: START_BLOCK is the block we want to start scanning and END_BLOCK is where to stop. X is needed for showing top X authors/curators/posts in that blocks range.

For the above example, we run:

python steempayouts.py 5694547 5723347 50

So it will get the entirely statistics for 10-October-2016, showing only top 50 stats boards, sorted by VESTS or SBD.
Results:

Top 50 authors sorted by VESTS:
[('infovore',
{'post_num': 3, 'sbd': 296.061, 'steem': 630.922, 'vest': 3888101.781129}),
('donkeypong',
{'post_num': 1, 'sbd': 278.138, 'steem': 538.504, 'vest': 3461553.665678}),
('macksby',
{'post_num': 3,

'sbd': 222.448,
'steem': 426.12199999999996,
'vest': 2757286.1792289997}),
('kevinwong',
{'post_num': 3,
'sbd': 212.63000000000002,
'steem': 420.78100000000006,
'vest': 2680161.3079440002}),
('dollarvigilante',
{'post_num': 2,
'sbd': 133.79899999999998,
'steem': 250.556,
'vest': 1637945.802102}),
...
Top 50 curators sorted by VESTS:
[('blocktrades',
{'reward_vest': 2691846.2968160002,
'unique_authors': {'alienbutt': 1,
'cognoscere': 1,
'dailybitcoinnews': 1,
'dumar022': 1,
'edgarsart': 1,
'elfkitchen': 1,
'elysehauser': 1,
'fiat19': 1,
'hilarious': 1,
'ivet': 1,
'jimitations': 1,
'karenb54': 1,
'kimal73': 1,
'ladypenelope1': 1,
'levinskaya': 1,
'maxjoy': 1,
'mindfreak': 1,
'numberone': 1,
'peerplays': 1,
'penguinpablo': 1,
'qkla': 1,
'scaitlyn': 1,
'siams': 1,
'smailer': 1,
'sompitonov': 1,
'tericano': 1,
'timer-the-teemer': 1,
'timsaid': 1,
'yetaras': 1,
'yogi': 1},
'votes_num': 30}),
('val-a',
{'reward_vest': 2011071.6632469995,
'unique_authors': {'abarefootpoet': 1,
'amy-oestreicher': 1,
'anwenbaumeister': 1,
'aphelion-i': 1,
'bigpchef': 1,
'boddhisattva': 1,
'curie': 1,
'donkeypong': 1,
'flandude': 1,
'ghostwriter': 1,
'grisha-danunaher': 1,
'havok777': 1,
'herverisson': 1,
'iamwne': 1,
'ianboil': 1,
'jay4u': 1,
'kaykunoichi': 1,
'kevinwong': 1,
'king3071': 1,
'kiwideb': 1,
'koskl': 1,
'krabgat': 1,
'littlescribe': 1,
'lordemau': 1,
'mariande': 1,
'markzka': 1,
'michaelstobiersk': 1,
'michelle.gent': 1,
'mrosenquist': 1,
'mweich': 1,
'nonameslefttouse': 1,
'outchemy': 1,
'puffin': 1,
'romanskv': 1,
'royalmacro': 1,
'scaredycatguide': 1,
'schattenjaeger': 1,
'sharker': 1,
'sircarlo': 1,
'steemcultures': 1,
'stephmckenzie': 1,
'stichin-sista': 1,
'streetstyle': 1,
'tarekadam': 1,
'techslut': 1,
'themagus': 1,
'unhorsepower777': 1,
'villainblack': 1,
'yogidream.scapes': 1},
'votes_num': 50}),
....
Top 50 posts sorted by SBD:
[('@infovore/re-kevinwong-past-present-and-future-a-personal-roadmap-56k-steem-power-1000-followers-90-blogposts-and-5-pounds-later-20161009t164416385z',
{'post_num': 3, 'sbd': 296.061, 'steem': 630.922, 'vest': 3888101.781129}),
('@donkeypong/the-lonely-pronghorn',
{'post_num': 1, 'sbd': 278.138, 'steem': 538.504, 'vest': 3461553.665678}),
('@macksby/wines-of-the-world-a-series-3',
{'post_num': 3,
'sbd': 222.448,
'steem': 426.12199999999996,
'vest': 2757286.1792289997}),
('@kevinwong/past-present-and-future-a-personal-roadmap-56k-steem-power-1000-followers-90-blogposts-and-5-pounds-later',
{'post_num': 3,
'sbd': 212.63000000000002,
'steem': 420.78100000000006,
'vest': 2680161.3079440002}),
('@infovore/steemmag-steemit-s-weekend-digest-13-of-discovery-mentorship-and-creativity-chat-with-an-early-investor-and-whale-the',
{'post_num': 1, 'sbd': 202.345, 'steem': 431.206, 'vest': 2657248.542168}),
('@dollarvigilante/helicopter-money-coming-exclusive-interview-with-top-hedge-fund-manager-tom-conrad',
{'post_num': 2,
'sbd': 133.79899999999998,
'steem': 250.556,
'vest': 1637945.802102}),
('@dollarvigilante/is-this-how-world-war-iii-begins-in-almost-complete-silence',
{'post_num': 1, 'sbd': 133.361, 'steem': 249.776, 'vest': 1632718.272759}),
('@ozchartart/usdsteem-btc-daily-poloniex-bittrex-technical-analysis-market-report-update-68-be-my-lil-rock-n-roll-coin-oct-08-2016',
{'post_num': 3,
'sbd': 114.12700000000001,
'steem': 202.834,
'vest': 1360142.5790269999}),
...
See the results in full here: http://pastebin.com/e72vSRxH

The code is released with The Unlicense, so feel free to use/clone/modify it the way you want (Website with customize stats could be built very easily).

If you support what I'm doing, don't forget to vote for witnesses here.

Thanks for reading.

Best regards,

Aizen

PS: Don't bomb my server with too many requests, it might die without any notice :P

Sort:  

Great job again! Thanks a bunch for your dedication and hard work, once more! Namaste :)

This would be helpful! Thanks for sharing

Very good post!

Thanks for this. How do I use this or interpret?
Upvoted.
Look at my funny new joke.

Great job!

This post has been linked to from another place on Steem.

Learn more about linkback bot v0.4. Upvote if you want the bot to continue posting linkbacks for your posts. Flag if otherwise.

Built by @ontofractal