create account

HBD Stats Now With a Backend and Auto Updating Charts by dalz

View this thread on: hive.blogpeakd.comecency.com
· @dalz ·
$66.49
HBD Stats Now With a Backend and Auto Updating Charts
I have been making some improvements to the hbdstats.com page, mainly on the backend side. 




![Capture1.PNG](https://files.peakd.com/file/peakd-hive/dalz/23swc1nwDsngWtxHBFs5Vxwgzi92oM19DUbL97Wt7jw7rrK9mR3ZbSDgqqhimMfeZVkhM.PNG)
https://www.hbdstats.com



Up until recently the web page was a client only, meaning there was no backend server or database for it. 
The line charts for the debt and the hbd in savings were with hardcoded values and manually updated from time to time. 

From a week ago this is not the case and now there is a MySQL database on the server with a express node app to get the data, create API endpoints and serve it to the web page.

API endpoints:
https://www.hbdstats.com/debt-data
https://www.hbdstats.com/savings-chart-data


The daily values for the debt are calculated and stored daily from the web page. The data for the hbd in savings is extracted from the hivesql database and then stored on the local database daily. 
Both of the line charts now have a longterm data in them.



Some screenshots.

Debt table:
 


![debt_data.PNG](https://files.peakd.com/file/peakd-hive/dalz/23tbExZ2RqkDVGGamu2EVQ31YPT3bzP29YUVDjKgzELcpjDR4YoamWY29Zn3uFWTfoD7N.PNG)


</br>


Savings table:




![savings_data.PNG](https://files.peakd.com/file/peakd-hive/dalz/23tGR5FdjnVmhXLdqk5cMiH2DL6Uy1aheHo3gEEdFEnJSL8LcCQ8X1xihNpnzfKShY5wW.PNG)

 


I have also fixed some bugs and UI improvements.
There was a bug for the gauge for the hbd in savings. Occasionally it was not loading due to not properly ordered execution steps. Calculate the share first then generate the chart. It was happening that the value was not calculated and the page was trying to generate the chart. Some small UI improvements with the viewports etc. 

This is a totally passionate project for me. I have built it and maintain it for free for Hivers to use it. But most of all it has been a learning	experience. As most Hivers probably know I have mainly been in the data analysis side of things, this is a step further to try and build web dashboards with a full tech stack implemented. 
From here on, I can easily add more features. Also, at some point I will probably upload all the code on Github/Gitlab as open source. 


It’s a simple small project but works. I have intentionally tried to make it with minimalistic design, not sure how other users receive it and like it. 

Please provide some feedback in the comments.

@dalz
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 483 others
properties (23)
authordalz
permlinkhbd-stats-now-with-a-backend-and-auto-updating-charts
categoryhbdstats
json_metadata{"app":"peakd/2024.8.7","format":"markdown","tags":["hbdstats","hbd","data","debt","hive","savings"],"users":["dalz"],"image":["https://files.peakd.com/file/peakd-hive/dalz/23swc1nwDsngWtxHBFs5Vxwgzi92oM19DUbL97Wt7jw7rrK9mR3ZbSDgqqhimMfeZVkhM.PNG","https://files.peakd.com/file/peakd-hive/dalz/23tbExZ2RqkDVGGamu2EVQ31YPT3bzP29YUVDjKgzELcpjDR4YoamWY29Zn3uFWTfoD7N.PNG","https://files.peakd.com/file/peakd-hive/dalz/23tGR5FdjnVmhXLdqk5cMiH2DL6Uy1aheHo3gEEdFEnJSL8LcCQ8X1xihNpnzfKShY5wW.PNG"]}
created2024-09-06 12:37:36
last_update2024-09-06 12:37:36
depth0
children29
last_payout2024-09-13 12:37:36
cashout_time1969-12-31 23:59:59
total_payout_value33.270 HBD
curator_payout_value33.222 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,429
author_reputation1,940,232,303,465,001
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,872,735
net_rshares253,620,886,339,168
author_curate_reward""
vote details (547)
@adese ·
$0.02
You are really doing a very great work on the app
Thank you for the update 
πŸ‘  
properties (23)
authoradese
permlinkre-dalz-sjedj8
categoryhbdstats
json_metadata{"tags":["hbdstats"],"app":"peakd/2024.8.7"}
created2024-09-06 15:25:57
last_update2024-09-06 15:25:57
depth1
children0
last_payout2024-09-13 15:25:57
cashout_time1969-12-31 23:59:59
total_payout_value0.010 HBD
curator_payout_value0.010 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length75
author_reputation21,964,300,013,056
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,875,466
net_rshares78,159,877,396
author_curate_reward""
vote details (1)
@bisolamih ·
This is a great work in the application 
It is useful 
properties (22)
authorbisolamih
permlinkre-dalz-202496t173655411z
categoryhbdstats
json_metadata{"tags":["hbdstats","hbd","data","debt","hive","savings"],"app":"ecency/3.2.0-vision","format":"markdown+html"}
created2024-09-06 16:36:57
last_update2024-09-06 16:36:57
depth1
children0
last_payout2024-09-13 16:36:57
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_length54
author_reputation77,951,619,462,723
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,876,735
net_rshares0
@claudio83 ·
$0.08
Nice work!

@tipu curate 
πŸ‘  
properties (23)
authorclaudio83
permlinkre-dalz-sje5vd
categoryhbdstats
json_metadata{"tags":["hbdstats"],"app":"peakd/2024.8.7"}
created2024-09-06 12:40:27
last_update2024-09-06 12:40:27
depth1
children1
last_payout2024-09-13 12:40:27
cashout_time1969-12-31 23:59:59
total_payout_value0.038 HBD
curator_payout_value0.037 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length25
author_reputation1,880,206,914,862,638
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,872,770
net_rshares290,619,005,726
author_curate_reward""
vote details (1)
@tipu ·
<a href="https://tipu.online/hive_curator?claudio83" target="_blank">Upvoted  &#128076;</a> (Mana: 41/51) <a href="https://peakd.com/hive/@reward.app/reward-app-quick-guide-updated" target="_blank">Liquid rewards</a>.
properties (22)
authortipu
permlinkre-re-dalz-sje5vd-20240906t124034z
categoryhbdstats
json_metadata"{"app": "beem/0.24.26"}"
created2024-09-06 12:40:33
last_update2024-09-06 12:40:33
depth2
children0
last_payout2024-09-13 12:40: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_length217
author_reputation55,938,753,231,183
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,872,773
net_rshares0
@curamax ·
$0.09
Great update! The auto-updating charts and backend improvements make the site even more useful for tracking HBD data in real-time.

![](https://images.ecency.com/DQmV1bP3ymA7RDc7tVM8WnUpeCbYoiK8e98GMX8LGQWGSGp/image.png)

It seems Hive is still able to maintain the peg at this point, which is pretty cool.
πŸ‘  
properties (23)
authorcuramax
permlinkre-dalz-202497t10290743z
categoryhbdstats
json_metadata{"tags":["hbdstats","hbd","data","debt","hive","savings"],"app":"ecency/3.2.0-vision","format":"markdown+html"}
created2024-09-07 02:29:00
last_update2024-09-07 02:29:00
depth1
children1
last_payout2024-09-14 02:29:00
cashout_time1969-12-31 23:59:59
total_payout_value0.044 HBD
curator_payout_value0.044 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length306
author_reputation1,127,293,232,599,689
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,884,196
net_rshares335,820,352,442
author_curate_reward""
vote details (1)
@dalz ·
Yes it has mobile view as well :)
properties (22)
authordalz
permlinksjfmn8
categoryhbdstats
json_metadata{"app":"hiveblog/0.1"}
created2024-09-07 07:40:21
last_update2024-09-07 07:40:21
depth2
children0
last_payout2024-09-14 07:40: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_length33
author_reputation1,940,232,303,465,001
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,887,367
net_rshares0
@hivebuzz ·
Congratulations @dalz! 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/@dalz/posts.png?202409061456"></td><td>You published more than 1000 posts.<br>Your next target is to reach 1100 posts.</td></tr>
<tr><td><img src="https://images.hive.blog/60x70/https://hivebuzz.me/@dalz/payout.png?202409061456"></td><td>You received more than 68000 HP as payout for your posts, comments and curation.<br>Your next payout target is 70000 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/@dalz) 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-106258/@hivebuzz/hivefest-2024-badge"><img src="https://images.hive.blog/64x128/https://files.peakd.com/file/peakd-hive/hivebuzz/48VEtcvs7eskeM4UMnbMF7M6zWzjp7R3P5s1cmYTXV6ZFuVmrWL16CfUuVt1JcmRox.png"></a></td><td><a href="/hive-106258/@hivebuzz/hivefest-2024-badge">The countdown to HiveFest⁹ is one week away - Join us and get your exclusive badge!</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pum-202408-delegations"><img src="https://images.hive.blog/64x128/https://i.imgur.com/fg8QnBc.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202408-delegations">Our Hive Power Delegations to the August PUM Winners</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202409-feedback"><img src="https://images.hive.blog/64x128/https://i.imgur.com/zHjYI1k.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202409-feedback">Feedback from the September Hive Power Up Day</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-1725635164
categoryhbdstats
json_metadata{"image":["https://hivebuzz.me/notify.t6.png"]}
created2024-09-06 15:06:03
last_update2024-09-06 15:06:03
depth1
children0
last_payout2024-09-13 15:06:03
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,930
author_reputation369,405,613,961,907
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,875,138
net_rshares0
@mypathtofire ·
$0.45
Great work on the App.

One question, is the Hive support price correct?  How can the price fall and this also goes down with it? Something doesn't math here.
πŸ‘  , ,
properties (23)
authormypathtofire
permlinkre-dalz-202496t15123361z
categoryhbdstats
json_metadata{"content_type":"general","type":"comment","tags":["hbdstats","hbd","data","debt","hive","savings"],"app":"ecency/3.1.5-mobile","format":"markdown+html"}
created2024-09-06 13:01:24
last_update2024-09-06 13:01:24
depth1
children12
last_payout2024-09-13 13:01:24
cashout_time1969-12-31 23:59:59
total_payout_value0.226 HBD
curator_payout_value0.227 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length158
author_reputation606,111,665,412,129
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,873,087
net_rshares1,735,535,209,751
author_curate_reward""
vote details (3)
@dalz ·
It is becouse of the lower HBD supply. More HBD is being burned as the price falls. Also the way the market cap is calculated from the virtual supply, and the calculation of the virtual supply that includes all the HBD converted to HIVE.
properties (22)
authordalz
permlinksje7j4
categoryhbdstats
json_metadata{"app":"hiveblog/0.1"}
created2024-09-06 13:16:06
last_update2024-09-06 13:16:06
depth2
children11
last_payout2024-09-13 13:16:06
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_length237
author_reputation1,940,232,303,465,001
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,873,315
net_rshares0
@mypathtofire ·
$0.54
I see, it is double counting the HBD "debt" as part of the market cap!!! 

DEBT = HBD in circulation / (Virtual HIVE Supply * Feed Price)


The Market cap is being overstated and the debt ratio understated!!

Either its debt or it is equity, it cant be both!!!  
πŸ‘  , ,
properties (23)
authormypathtofire
permlinkre-dalz-sjec2m
categoryhbdstats
json_metadata{"tags":["hbdstats"],"app":"peakd/2024.8.7"}
created2024-09-06 14:54:21
last_update2024-09-06 14:54:21
depth3
children10
last_payout2024-09-13 14:54:21
cashout_time1969-12-31 23:59:59
total_payout_value0.270 HBD
curator_payout_value0.270 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length262
author_reputation606,111,665,412,129
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,874,941
net_rshares2,054,136,372,595
author_curate_reward""
vote details (3)
@nathen007 ·
$0.09
Just an aside, have you noticed HBD and jumped above SBD in market cap according to coingecko.

Keep up the good work, I love reading about statistics.

Best wishes :-)
πŸ‘  
properties (23)
authornathen007
permlinkre-dalz-202496t20295964z
categoryhbdstats
json_metadata{"content_type":"general","type":"comment","tags":["hbdstats","hbd","data","debt","hive","savings"],"app":"ecency/3.1.5-mobile","format":"markdown+html"}
created2024-09-06 13:29:06
last_update2024-09-06 13:29:06
depth1
children0
last_payout2024-09-13 13:29:06
cashout_time1969-12-31 23:59:59
total_payout_value0.046 HBD
curator_payout_value0.046 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length168
author_reputation262,474,049,654,114
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,873,479
net_rshares354,455,344,765
author_curate_reward""
vote details (1)
@olympicdragon ·
$0.09
The app neat and smooth. Simple to use !
πŸ‘  
properties (23)
authorolympicdragon
permlinkre-dalz-202496t214617375z
categoryhbdstats
json_metadata{"content_type":"general","type":"comment","tags":["hbdstats","hbd","data","debt","hive","savings"],"app":"ecency/3.1.5-mobile","format":"markdown+html"}
created2024-09-06 13:46:18
last_update2024-09-06 13:46:18
depth1
children0
last_payout2024-09-13 13:46:18
cashout_time1969-12-31 23:59:59
total_payout_value0.046 HBD
curator_payout_value0.046 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length40
author_reputation34,659,922,596,582
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,873,732
net_rshares351,345,515,462
author_curate_reward""
vote details (1)
@resiliencia ·
$0.05
Cool! thanks for updating the website @dalz! 
πŸ‘  
properties (23)
authorresiliencia
permlinkre-dalz-sjekvg
categoryhbdstats
json_metadata{"tags":["hbdstats"],"app":"peakd/2024.8.7"}
created2024-09-06 18:04:27
last_update2024-09-06 18:04:27
depth1
children0
last_payout2024-09-13 18:04:27
cashout_time1969-12-31 23:59:59
total_payout_value0.026 HBD
curator_payout_value0.027 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length45
author_reputation438,639,187,237,143
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,878,107
net_rshares207,291,904,356
author_curate_reward""
vote details (1)
@toofasteddie ·
$0.09
It’s really a good tool, I really like the minimalistic approach 
πŸ‘  
properties (23)
authortoofasteddie
permlinkre-dalz-202496t153414182z
categoryhbdstats
json_metadata{"content_type":"general","type":"comment","tags":["hbdstats","hbd","data","debt","hive","savings"],"app":"ecency/3.1.5-mobile","format":"markdown+html"}
created2024-09-06 13:34:12
last_update2024-09-06 13:34:12
depth1
children5
last_payout2024-09-13 13:34:12
cashout_time1969-12-31 23:59:59
total_payout_value0.046 HBD
curator_payout_value0.046 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length65
author_reputation670,805,279,953,027
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,873,552
net_rshares352,895,521,248
author_curate_reward""
vote details (1)
@dalz ·
$0.05
Thansk!
Is there any other info, or chart you want to see for hbd, added here?
πŸ‘  
properties (23)
authordalz
permlinksjebxd
categoryhbdstats
json_metadata{"app":"hiveblog/0.1"}
created2024-09-06 14:51:12
last_update2024-09-06 14:51:12
depth2
children4
last_payout2024-09-13 14:51:12
cashout_time1969-12-31 23:59:59
total_payout_value0.024 HBD
curator_payout_value0.024 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length78
author_reputation1,940,232,303,465,001
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,874,867
net_rshares185,064,175,682
author_curate_reward""
vote details (1)
@toofasteddie ·
perhaps would be good to build a chart showing the relation between HBD that is being used (for APR in savings or proposals payments) and the Debt in a graphical manner...
properties (22)
authortoofasteddie
permlinkre-dalz-sjedug
categoryhbdstats
json_metadata{"tags":["hbdstats"],"app":"peakd/2024.8.7"}
created2024-09-06 15:32:42
last_update2024-09-06 15:32:42
depth3
children3
last_payout2024-09-13 15:32:42
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_length171
author_reputation670,805,279,953,027
root_title"HBD Stats Now With a Backend and Auto Updating Charts"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,875,566
net_rshares0