Simple stats dashboard for curators and witnesses

By techcoderx on 6/9/2025

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.


Curation Summary

![](Image from post)

Curation has been widely discussed recently, besides the krampus co-efficient, 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 (forked from SteemWorld) and adopted for the curation summary dashboard.

The first step was to determine the voting CSI formula, which can be found here. 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]

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. You may append a user query parameter to the URL to specify the username on initial page load, like this.

Page source code may be found here.


Witness Reward Stats

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

Source code of the HAF app and frontend may be found here.

Comments (8)

gadrian's avatar @gadrian 6/9/2025

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

techcoderx's avatar @techcoderx 6/10/2025

Indeed, much easier to query data beyond what standard APIs provide.

steevc's avatar @steevc 6/9/2025

This is neat. I think people should be encouraged to spread out their votes and you app shows it well.

!BEER

beerlover's avatar @beerlover 6/9/2025
https://files.peakd.com/file/peakd-hive/beerlover/yiuU6bdf-beerlover20gives20BEER.gif

View or trade BEER.


Hey @techcoderx, here is a little bit of BEER from @steevc for you. Enjoy it!

Learn how to earn FREE BEER each day by staking your BEER.

beerlover's avatar @beerlover 6/9/2025
https://files.peakd.com/file/peakd-hive/beerlover/yiuU6bdf-beerlover20gives20BEER.gif

View or trade BEER.


Hey @techcoderx, here is a little bit of BEER from @steevc for you. Enjoy it!

Do you want to win SOME BEER together with your friends and draw the BEERKING.

livinguktaiwan's avatar @livinguktaiwan 6/9/2025

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?

techcoderx's avatar @techcoderx 6/10/2025

Formula does not look bounded by a min/max value. Yes, the score worsens the more concentrated the votes are.

Some real examples:

livinguktaiwan's avatar @livinguktaiwan 6/10/2025

The first two examples are interesting. So more self vote lowers the score. That's good

shmoogleosukami's avatar @shmoogleosukami 6/9/2025

The witness rewards tool is pretty sweet, Always wondered how much I've made from being a witness so far.

sanjeevm's avatar @sanjeevm 6/10/2025

Thank you for the curation summary page, how do we know the reward from it ?

techcoderx's avatar @techcoderx 6/10/2025

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.

hivebuzz's avatar @hivebuzz 6/30/2025

Congratulations @techcoderx! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 5000 HP as payout for your posts, comments and curation.
Your next payout target is 6000 HP.
The unit is Hive Power equivalent because post and comment rewards can be split into HP and HBD

You can view your badges on your board and compare yourself to others in the Ranking If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Be ready for the July edition of the Hive Power Up Month!
Hive Power Up Day - July 1st 2025