How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours? by justyy

View this thread on steempeak.com
· @justyy ·
$41.62
How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?
The blockchain is a public database, this shouldn't be hard to find out. In [this post](https://helloacm.com/the-python-function-to-retrieve-the-producer-reward-for-witness/) we know how to call the Steem API to find out the witness that procduce each block and the reward (in VESTS) he/she collects for generating the block (mining).

Let's create a database in SQLite - with the schema:

```
sqlite> .schema
CREATE TABLE witnessblocks (
witness text,
number integer,
vests real,
time text,
block integer,
constraint pkey primary key (block)
);
CREATE INDEX index_block on witnessblocks(block);
CREATE INDEX index_witness on witnessblocks(witness);
CREATE INDEX index_time on witnessblocks(time);
CREATE INDEX index_vests on witnessblocks(vests);
CREATE INDEX index_number on witnessblocks(number);
```

Then, we can run a SQL to find out the number of blocks and total rewards for each witness. Results are sorted by total rewards in SP (which can be computed by simply roughly divided by 1943 SP) - see this number at: [https://steemyy.com](https://steemyy.com)

Query:
```
sqlite> select witness,count(1), sum(vests/1943.761) as total from witnessblocks where time >= date('now', '-24 hour')  group by witness order by total desc limit 30;
```

Result (a bit surprising, more than expected, different than what the steemworld says @steemchiller): I double check the data and everything seems correct. My understanding is that a lot of misses are re-scheduled and that is why the TOP witnesses get more turns to produce blocks.

```
justyy|2326|578.82025257632
steemchiller|2324|578.325146664636
hinomaru-jp|2324|578.322147174472
hivei0|2323|578.073978002953
scissor.sisters|2322|577.826185736312
dlike|2321|577.5771644482
steem-supporter|2320|577.328037061142
inwi|2319|577.082116292075
beargame|2319|577.079035895361
smt-wherein|2318|576.832034089068
steem-dragon|2318|576.831055014993
roundblocknew|2318|576.828982039459
rnt1|2317|576.583037687762
hoasen|2317|576.582024700568
symbionts|2317|576.578049543128
steem-agora|2316|576.338157853255
maiyude|2316|576.336006269803
future.witness|2313|575.584969334193
protoss20|2309|574.593023568226
dev.supporters|2305|573.596812309745
matreshka|193|240.560583586665
parse|192|239.309574386974
cryptoking777|191|238.066390513031
menacamel|191|238.066344493484
juddsmith079|190|236.823358969544
enjoylondon|190|236.815291552305
rlawlstn123|187|233.082098971016
leverfile|186|231.834906382009
upeross|185|230.587764003393
roadofrich|30|37.3927565415707
```

Once this data is verified, I'll add it to the [witness ranking table](https://steemyy.com/witness-ranking/)

<hr/>

Every little helps! I hope this helps!


**Steem On!~**
*[Reposted to Computing & Technology](https://helloacm.com/how-many-blocks-and-total-rewards-for-a-steem-witness-in-the-past-24-hours/)*
------------------

If you like my work, please consider voting for me, thanks!
https://steemit.com/~witnesses type in **justyy** and click ***VOTE***
https://steemyy.com/images/vote-for-justyy.jpg
<BR/>
**Alternatively, you could [proxy to me](https://steemyy.com/witness-voting/?witness=justyy&action=proxy)  if you are too lazy to vote!**

Also: you can vote me at the tool I made:  https://steemyy.com/witness-voting/?witness=justyy

### Visit me at:  [https://steemyy.com](https://steemyy.com)
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 115 others
👎  
properties (23)
post_id86,637,836
authorjustyy
permlinkhow-many-blocks-and-total-rewards-for-a-steem-witness-in-the-past-24-hours
categorywitness-category
json_metadata{"tags":["witness-category","witness","whalepower","producer-reward","steem","sql","steem-dev","codeonsteem"],"users":["steemchiller"],"image":["https:\/\/steemyy.com\/images\/vote-for-justyy.jpg"],"links":["https:\/\/helloacm.com\/the-python-function-to-retrieve-the-producer-reward-for-witness\/","https:\/\/steemyy.com","https:\/\/steemyy.com\/witness-ranking\/","https:\/\/helloacm.com\/how-many-blocks-and-total-rewards-for-a-steem-witness-in-the-past-24-hours\/","https:\/\/steemit.com\/~witnesses","https:\/\/steemyy.com\/witness-voting\/?witness=justyy&action=proxy","https:\/\/steemyy.com\/witness-voting\/?witness=justyy"],"app":"steemit\/0.2","format":"markdown"}
created2020-07-09 16:57:18
last_update2020-07-09 16:57:18
depth0
children16
net_rshares62,579,744,046,535
last_payout2020-07-16 16:57:18
cashout_time1969-12-31 23:59:59
total_payout_value22.470 SBD
curator_payout_value19.152 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length3,313
author_reputation2,052,211,997,492,585
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (180)
@famigliacurione ·
$0.10
Hello Justyy, thank you for all the great work you are doing for the Steem blockchain! Would it be possible to create a list of the Most Downvoted Accounts??? The Top Muted Accounts feature was really helpful for my Troll Hunters Community, and I thought it would be great to add to that the most Downvoted accounts, as a way of discovering abusive users. Thanks again!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id86,637,947
authorfamigliacurione
permlinkqd7p78
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-09 17:14:00
last_update2020-07-09 17:14:00
depth1
children2
net_rshares259,158,573,888
last_payout2020-07-16 17:14:00
cashout_time1969-12-31 23:59:59
total_payout_value0.050 SBD
curator_payout_value0.050 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length369
author_reputation121,774,275,823,341
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (47)
@justyy ·
$0.43
Thank you. Interesting idea! I'll definitely think about it
👍  ,
properties (23)
post_id86,638,462
authorjustyy
permlinkqd7rzt
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-09 18:14:21
last_update2020-07-09 18:14:21
depth2
children1
net_rshares1,012,425,025,487
last_payout2020-07-16 18:14:24
cashout_time1969-12-31 23:59:59
total_payout_value0.214 SBD
curator_payout_value0.214 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length59
author_reputation2,052,211,997,492,585
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (2)
@famigliacurione ·
That's excellent! Thank you for considering it, I really appreciate it!
properties (22)
post_id86,645,692
authorfamigliacurione
permlinkqd8y8y
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-10 09:27:03
last_update2020-07-10 09:27:03
depth3
children0
net_rshares0
last_payout2020-07-17 09:27:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length71
author_reputation121,774,275,823,341
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@steemchiller · (edited)
$0.82
Also the sums on SteemWorld are built by adding the vests of all received `producer_reward` operations in that time period. When I multiply the daily amount from SteemWorld (~342.18 SP) by 30 (days), I come to the correct monthly rewards.

Maybe it's related to the time in your WHERE clause `time >= date('now', '-24 hour')`. Can it be that your script begins to count from start of the previous day? If the field 'time' in your table is a date (without time) or the `date()` method returns a date instead of a datetime, I think this likely is the case.

For time fields I always use integers and store the unix time. I think this makes it easier to work with time ranges.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 5 others
properties (23)
post_id86,638,385
authorsteemchiller
permlinkqd7rkh
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-09 18:05:06
last_update2020-07-09 18:13:03
depth1
children8
net_rshares1,818,128,303,992
last_payout2020-07-16 18:05:06
cashout_time1969-12-31 23:59:59
total_payout_value0.410 SBD
curator_payout_value0.409 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length673
author_reputation278,255,940,220,712
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (69)
@justyy ·
$0.61
Yes, you are right.  I should use `datetime('now', '-24 hour')` instead of `date('now', '-24 hour')`
👍  , ,
properties (23)
post_id86,638,497
authorjustyy
permlinkqd7s51
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-09 18:17:30
last_update2020-07-09 18:17:30
depth2
children0
net_rshares1,390,656,514,713
last_payout2020-07-16 18:17:30
cashout_time1969-12-31 23:59:59
total_payout_value0.304 SBD
curator_payout_value0.304 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length100
author_reputation2,052,211,997,492,585
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (3)
@mundharmonika ·
$0.68
Einen weiteren Verbesserungsvorschlag für das Copy-Vote-Tool hätte ich: Ich werde oft in beide Richtungen überrascht, wie viel bzw. wenig meiner VP verbraucht wird, da ich immer "Copy voted weight" aktiviere. Wieviel % gegeben wurden, kann ich nur aufwändig einzeln feststellen über das Popup mit der Votes-Statistik. Und dann müsste ich auch noch die % zusammenzählen, um feststellen zu können, wieviel % ich ungefähr verbraten werde.

In der Liste wäre Platz für die Darstellung des Voteweights und einer Summe dazu. Daraus lässt sich zwar der genaue VP-Verbrauch nicht ermitteln, aber in hinreichender Näherung. Die resultierende ungefähre Wiederaufladezeit liesse sich wiederum daraus leicht errechnen und auch darstellen.
👍  
properties (23)
post_id86,648,503
authormundharmonika
permlinkqd9c6q
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-10 14:28:24
last_update2020-07-10 14:28:24
depth2
children6
net_rshares1,556,226,818,029
last_payout2020-07-17 14:28:24
cashout_time1969-12-31 23:59:59
total_payout_value0.340 SBD
curator_payout_value0.341 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length726
author_reputation27,471,912,141,256
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@steemchiller ·
$0.44
Ja, das halte ich für eine sehr gute Idee, die sich auch recht schnell umsetzen lässt. Vielleicht kann ich das sogar noch heute Abend reinbringen ;)
👍  , , , , , , , ,
properties (23)
post_id86,649,216
authorsteemchiller
permlinkqd9ezd
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-10 15:28:24
last_update2020-07-10 15:28:24
depth3
children0
net_rshares1,055,835,116,552
last_payout2020-07-17 15:28:24
cashout_time1969-12-31 23:59:59
total_payout_value0.220 SBD
curator_payout_value0.220 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length148
author_reputation278,255,940,220,712
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (9)
@steemchiller ·
$0.42
Das Vote-Weight ist jetzt schon mal mit in der Liste ;)

https://cdn.steemitimages.com/DQmab4D8iS1eNxxUchCdVcgMRZc71UZfa4mTmuDHaQDgtYZ/steemworld-copy-votes-weight.png
👍  
properties (23)
post_id86,760,733
authorsteemchiller
permlinkqdqhk4
categorywitness-category
json_metadata{"image":["https:\/\/cdn.steemitimages.com\/DQmab4D8iS1eNxxUchCdVcgMRZc71UZfa4mTmuDHaQDgtYZ\/steemworld-copy-votes-weight.png"],"app":"steemit\/0.2"}
created2020-07-19 20:43:15
last_update2020-07-19 20:43:15
depth3
children4
net_rshares972,179,420,621
last_payout2020-07-26 20:43:15
cashout_time1969-12-31 23:59:59
total_payout_value0.208 SBD
curator_payout_value0.209 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length167
author_reputation278,255,940,220,712
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@yanhan ·
$0.08
properties (23)
post_id86,641,663
authoryanhan
permlinkqd8c3z
categorywitness-category
json_metadata{"app":"steemcn\/0.1"}
created2020-07-10 01:28:54
last_update2020-07-10 01:28:54
depth1
children1
net_rshares219,746,356,354
last_payout2020-07-17 01:28:54
cashout_time1969-12-31 23:59:59
total_payout_value0.042 SBD
curator_payout_value0.042 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length6
author_reputation86,430,428,607,483
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (46)
@justyy ·
感谢。回赞。
👍  
properties (23)
post_id86,647,870
authorjustyy
permlinkqd99oq
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-10 13:34:03
last_update2020-07-10 13:34:03
depth2
children0
net_rshares287,684,776
last_payout2020-07-17 13:34:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length6
author_reputation2,052,211,997,492,585
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@glory7 ·
$0.09
properties (23)
post_id86,641,823
authorglory7
permlinkqd8d4f
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-10 01:50:39
last_update2020-07-10 01:50:39
depth1
children1
net_rshares226,756,867,763
last_payout2020-07-17 01:50:39
cashout_time1969-12-31 23:59:59
total_payout_value0.044 SBD
curator_payout_value0.043 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length95
author_reputation1,494,322,874,274,224
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (56)
@justyy ·
Thanks.. yes, the TOP 20 gets most slices of the cake. 😅
👍  
properties (23)
post_id86,647,865
authorjustyy
permlinkqd99o0
categorywitness-category
json_metadata{"app":"steemit\/0.2"}
created2020-07-10 13:33:42
last_update2020-07-10 13:33:42
depth2
children0
net_rshares294,525,034
last_payout2020-07-17 13:33:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length56
author_reputation2,052,211,997,492,585
root_title"How Many Blocks and Total Rewards for a Steem Witness in the Past 24 Hours?"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)