create account

Simple stats dashboard for curators and witnesses by techcoderx

View this thread on: hive.blogpeakd.comecency.com
· @techcoderx ·
$12.28
Simple stats dashboard for curators and witnesses
Today I'm releasing two simple HAF-powered dashboards that some may be interested in as it has been a hot topic of discussion lately.

These pages are built with Bootstrap 5 and may be a precursor to a more comprehensive personal dashboard that I (or someone else) may wish to build later.

<hr>

# Curation Summary

<center>![](https://files.peakd.com/file/peakd-hive/techcoderx/23uQG62iUwa19AuteMQt3chTfYi5B9Byav5p1ns3bzSwmwBKLozXrMpvEhpenUjotJRFM.png)</center>

Curation has been widely discussed recently, besides the [krampus co-efficient](/hive-111111/@techcoderx/thoughts-on-krampus-ratio-stake-shaming-and-accountability), another metric being used by some is the voting CSI score. In short, it shows how spread out their curation activities are taking weights of upvotes and the number of unique accounts voted in the last 7 days, higher the better. This metric was taken from [Hivetasks](https://hivetasks.com) (forked from ~~Steem~~World) and adopted for the curation summary dashboard.

The first step was to determine the voting CSI formula, which can be found [here](https://github.com/fernandosoder/Hivetasks/blob/master/res/js/sw.out.min.js#L11895-L11923). This was the part many could not find, however it took only 5 minutes to search and around 15 minutes to decipher what some variables mean.

Next step was to obtain the data required to calculate the score. Hivetasks calls account history API for the last 7 days to construct the source data which is not the most efficient way. As this isn't something standard APIs currently provide, I took advantage of having access to a HAF database with to query the voting data more efficiently. The query requires `hivemind_app` to be synced.

>! [Click to reveal function]
>```sql
>CREATE OR REPLACE FUNCTION witstats_api.outgoing_votes_summary(voter VARCHAR, last_days INT, direction INT)
>RETURNS jsonb AS $function$
>BEGIN
>  IF (SELECT hive.is_app_in_sync('hivemind_app') IS FALSE) THEN
>    RAISE EXCEPTION 'hivemind_app is not in sync';
>  END IF;
>  IF last_days < 1 OR last_days > 30 THEN
>    RAISE EXCEPTION 'last_days must be between 1 and 30';
>  ELSIF direction != 1 AND direction != 2 THEN
>    RAISE EXCEPTION 'direction must be 1 (upvote) or 2 (downvote)';
>  ELSIF voter IS NULL OR LENGTH(voter) = 0 THEN
>    RAISE EXCEPTION 'invalid voter';
>  END IF;
>  RETURN (
>    WITH summary AS (
>      SELECT aa.name as author, SUM(vote_percent) as vote_weight_agg, COUNT(v.author_id) as vote_count
>      FROM hivemind_app.hive_votes v
>      JOIN hivemind_app.hive_accounts aa ON
>        aa.id = v.author_id
>      JOIN hivemind_app.hive_accounts va ON
>        va.id = v.voter_id
>      WHERE va.name = voter AND v.last_update > NOW()::TIMESTAMP - (last_days * interval '1 day') AND (SELECT CASE WHEN direction = 1 THEN vote_percent > 0 ELSE vote_percent < 0 END)
>      GROUP BY aa.name
>      ORDER BY vote_count DESC, vote_weight_agg DESC
>    )
>    SELECT jsonb_agg(jsonb_build_object(
>      'author', s.author,
>      'weights', s.vote_weight_agg,
>      'count', s.vote_count
>    ))
>    FROM summary s
>  );
>END $function$
>LANGUAGE plpgsql STABLE;
>```

The page is available [here](https://techcoderx.com/curation). You may append a `user` query parameter to the URL to specify the username on initial page load, [like this](https://techcoderx.com/curation?user=acidyo).

Page source code may be found [here](https://github.com/techcoderx/witness-reward-stats/blob/main/frontend/curation/index.html).

<hr>

# Witness Reward Stats

![](https://files.peakd.com/file/peakd-hive/techcoderx/23tbM6Eu4V2CYZmQqAYKcj6ysv6MFCzyrkjW3iMV5mLWrMMwHRShJoV4tUBuKSkPg9akb.png)

This is for those that want to know producer rewards and number of blocks produced of a witness over a certain period of time. The data goes all the way back to the genesis block or the first block the witness has ever produced, whichever is later. This does not include producer rewards paid in liquid HIVE which may be the case prior to block 864,000.

The chart is available at daily, monthly and yearly intervals. Total HIVE rewards displayed here are converted from VESTS at time of block production.

The page is available [here](https://techcoderx.com/witreward). Just like curation summary, you may also append a `user` query parameter to the URL to specify the username on initial page load, [like this](https://techcoderx.com/witreward?user=arcange).

Source code of the HAF app and frontend may be found [here](https://github.com/techcoderx/witness-reward-stats).
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 276 others
properties (23)
authortechcoderx
permlinksimple-stats-dashboard-for-curators-and-witnesses
categoryhive-139531
json_metadata"{"app":"peakd/2025.6.1","format":"markdown","description":"Summary of curation activity and witness rewards.","tags":["analytics","stats","curation","witness","dev","haf","dashboard"],"users":["techcoderx"],"image":["https://files.peakd.com/file/peakd-hive/techcoderx/23uQG62iUwa19AuteMQt3chTfYi5B9Byav5p1ns3bzSwmwBKLozXrMpvEhpenUjotJRFM.png","https://files.peakd.com/file/peakd-hive/techcoderx/23tbM6Eu4V2CYZmQqAYKcj6ysv6MFCzyrkjW3iMV5mLWrMMwHRShJoV4tUBuKSkPg9akb.png"]}"
created2025-06-09 15:26:54
last_update2025-06-09 15:26:54
depth0
children12
last_payout2025-06-16 15:26:54
cashout_time1969-12-31 23:59:59
total_payout_value6.158 HBD
curator_payout_value6.121 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4,530
author_reputation47,797,995,910,732
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id143,262,016
net_rshares40,837,011,803,428
author_curate_reward""
vote details (340)
@beerlover ·
<div class='pull-right'>https://files.peakd.com/file/peakd-hive/beerlover/yiuU6bdf-beerlover20gives20BEER.gif<p><sup><a href='https://hive-engine.com/?p=market&t=BEER'>View or trade </a> <code>BEER</code>.</sup></p></div><center><br> <p>Hey @techcoderx, here is a little bit of <code>BEER</code> from @steevc for you. Enjoy it!</p> <p>Learn how to <a href='https://peakd.com/beer/@beerlover/what-is-proof-of-stake-with-beer'>earn <b>FREE BEER</b> each day </a> by staking your <code>BEER</code>.</p> </center><div></div>
properties (22)
authorbeerlover
permlinkre-techcoderx-simple-stats-dashboard-for-curators-and-witnesses-20250609t210024463z
categoryhive-139531
json_metadata{"app":"beerlover/3.0","language":"rust","developer":"wehmoen"}
created2025-06-09 21:00:24
last_update2025-06-09 21:00:24
depth1
children0
last_payout2025-06-16 21:00:24
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_length521
author_reputation25,827,334,384,261
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,266,746
net_rshares0
@beerlover ·
<div class='pull-right'>https://files.peakd.com/file/peakd-hive/beerlover/yiuU6bdf-beerlover20gives20BEER.gif<p><sup><a href='https://hive-engine.com/?p=market&t=BEER'>View or trade </a> <code>BEER</code>.</sup></p></div><center><br> <p>Hey @techcoderx, here is a little bit of <code>BEER</code> from @steevc for you. Enjoy it!</p> <p>Do you want to <a href='https://friends.beersaturday.com/'>win <b>SOME BEER</b> together with your friends </a> and draw the <code>BEERKING</code>.</p> </center><div></div>
properties (22)
authorbeerlover
permlinkre-techcoderx-simple-stats-dashboard-for-curators-and-witnesses-20250609t210030613z
categoryhive-139531
json_metadata{"app":"beerlover/3.0","language":"rust","developer":"wehmoen"}
created2025-06-09 21:00:30
last_update2025-06-09 21:00:30
depth1
children0
last_payout2025-06-16 21:00:30
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_length508
author_reputation25,827,334,384,261
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,266,749
net_rshares0
@gadrian ·
$0.33
Thanks for the tools. I missed having view like the distribution of votes. I tried out HiveTasks a few times in the past, and the tools I tried didn't work for me so I gave up on checking it any longer. HAF-based tools are already next generation...
👍  ,
👎  , , , , , , , , , , , ,
properties (23)
authorgadrian
permlinkre-techcoderx-sxludw
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.6.1","image":[],"users":[]}
created2025-06-09 20:03:33
last_update2025-06-09 20:03:33
depth1
children1
last_payout2025-06-16 20:03:33
cashout_time1969-12-31 23:59:59
total_payout_value0.164 HBD
curator_payout_value0.164 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length249
author_reputation644,691,742,451,719
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,266,119
net_rshares1,087,674,730,241
author_curate_reward""
vote details (15)
@techcoderx ·
Indeed, much easier to query data beyond what standard APIs provide.
properties (22)
authortechcoderx
permlinkre-gadrian-sxm5x9
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.6.1"}
created2025-06-10 00:12:45
last_update2025-06-10 00:12:45
depth2
children0
last_payout2025-06-17 00:12:45
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_length68
author_reputation47,797,995,910,732
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,269,228
net_rshares0
@hivebuzz ·
Congratulations @techcoderx! 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/https://hivebuzz.me/@techcoderx/payout.png?202506301629"></td><td>You received more than 5000 HP as payout for your posts, comments and curation.<br>Your next payout target is 6000 HP.<br><sub>The unit is Hive Power equivalent because post and comment rewards can be split into HP and HBD</sub></td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@techcoderx) and compare yourself to others in 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>



**Check out our last posts:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-202507"><img src="https://images.hive.blog/64x128/https://i.imgur.com/M9RD8KS.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202507">Be ready for the July edition of the Hive Power Up Month!</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202507"><img src="https://images.hive.blog/64x128/https://i.imgur.com/805FIIt.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202507">Hive Power Up Day - July 1st 2025</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-1751301464
categoryhive-139531
json_metadata{"image":["https://hivebuzz.me/notify.t6.png"]}
created2025-06-30 16:37:45
last_update2025-06-30 16:37:45
depth1
children0
last_payout2025-07-07 16:37:45
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,312
author_reputation370,747,128,097,864
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,669,790
net_rshares0
@livinguktaiwan ·
$0.30
Thanks for the CSI tool. It's neat.

I see the CSI can be negative when the upvotes are highly concentrated to an account. Just  curious, based on the formula, is there a min or max score? Like if I were to only upvote 1 account all the time, how low would that go? And will the score differ if I cast only 1x100% upvote Vs 10x100% to one account only?
👍  ,
properties (23)
authorlivinguktaiwan
permlinkre-techcoderx-sxlzw4
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.6.1","image":[],"users":[]}
created2025-06-09 22:02:27
last_update2025-06-09 22:02:27
depth1
children2
last_payout2025-06-16 22:02:27
cashout_time1969-12-31 23:59:59
total_payout_value0.148 HBD
curator_payout_value0.148 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length352
author_reputation1,683,707,409,886,159
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,267,552
net_rshares974,593,687,796
author_curate_reward""
vote details (2)
@techcoderx ·
$0.11
Formula does not look bounded by a min/max value. Yes, the score worsens the more concentrated the votes are.

Some real examples:
* [Using all voting power towards one account](https://techcoderx.com/curation?user=themarkymark) (-2.78)
* [Using all voting power towards self](https://techcoderx.com/curation?user=buildawhale) (-7.72)
* [Only one 100% vote](https://techcoderx.com/curation?user=randomvlogs) (0.95)
👍  
properties (23)
authortechcoderx
permlinkre-livinguktaiwan-sxm5n1
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.6.1"}
created2025-06-10 00:06:39
last_update2025-06-10 00:06:39
depth2
children1
last_payout2025-06-17 00:06:39
cashout_time1969-12-31 23:59:59
total_payout_value0.052 HBD
curator_payout_value0.053 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length414
author_reputation47,797,995,910,732
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,269,157
net_rshares349,900,247,137
author_curate_reward""
vote details (1)
@livinguktaiwan ·
The first two examples are interesting. So more self vote lowers the score. That's good 
👍  
properties (23)
authorlivinguktaiwan
permlinkre-techcoderx-sxnafa
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.6.1"}
created2025-06-10 14:47:33
last_update2025-06-10 14:47:33
depth3
children0
last_payout2025-06-17 14:47:33
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_length88
author_reputation1,683,707,409,886,159
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,279,916
net_rshares0
author_curate_reward""
vote details (1)
@sanjeevm ·
$0.29
Thank you for the curation summary page, how do we know the reward from it ? 
👍  
properties (23)
authorsanjeevm
permlinkre-techcoderx-sxmitw
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.6.1","image":[],"users":[]}
created2025-06-10 04:51:36
last_update2025-06-10 04:51:36
depth1
children1
last_payout2025-06-17 04:51:36
cashout_time1969-12-31 23:59:59
total_payout_value0.144 HBD
curator_payout_value0.143 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length77
author_reputation720,756,364,147,578
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,271,826
net_rshares933,087,436,806
author_curate_reward""
vote details (1)
@techcoderx ·
$0.07
Main focus on that page is the voting CSI score for now. Curation rewards and APR will probably be part of the comprehensive personal dashboard but that's low priority for me right now.
👍  
properties (23)
authortechcoderx
permlinkre-sanjeevm-sxmmn3
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.6.1"}
created2025-06-10 06:13:54
last_update2025-06-10 06:13:54
depth2
children0
last_payout2025-06-17 06:13:54
cashout_time1969-12-31 23:59:59
total_payout_value0.037 HBD
curator_payout_value0.037 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length185
author_reputation47,797,995,910,732
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,272,906
net_rshares253,320,735,491
author_curate_reward""
vote details (1)
@shmoogleosukami ·
$0.31
The witness rewards tool is pretty sweet, Always wondered how much I've made from being a witness so far.
👍  ,
properties (23)
authorshmoogleosukami
permlinkre-techcoderx-sxm25q
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.6.1","image":[],"users":[]}
created2025-06-09 22:51:27
last_update2025-06-09 22:51:27
depth1
children0
last_payout2025-06-16 22:51:27
cashout_time1969-12-31 23:59:59
total_payout_value0.157 HBD
curator_payout_value0.157 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length105
author_reputation227,677,396,580,585
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,268,203
net_rshares1,037,226,045,038
author_curate_reward""
vote details (2)
@steevc ·
$0.28
This is neat. I think people should be encouraged to spread out their votes and you app shows it well.

!BEER
👍  ,
properties (23)
authorsteevc
permlinkre-techcoderx-sxlx09
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2025.6.1","image":[],"users":[]}
created2025-06-09 21:00:12
last_update2025-06-09 21:00:12
depth1
children0
last_payout2025-06-16 21:00:12
cashout_time1969-12-31 23:59:59
total_payout_value0.142 HBD
curator_payout_value0.142 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length109
author_reputation1,393,404,291,442,827
root_title"Simple stats dashboard for curators and witnesses"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id143,266,743
net_rshares938,423,664,857
author_curate_reward""
vote details (2)