create account

Question about Python-Steem: real curation rewards ? by felixxx

View this thread on: hive.blogpeakd.comecency.com
· @felixxx ·
$0.43
Question about Python-Steem: real curation rewards ?
I'm playing with the latest Python-Steem release.
I made this little script, that adds up all my curation rewards, ever.

I'm using the Account.history function to list the rewards.
When I add them all up, the number doesn't match the _curation_rewards_ as shown by Account.export.
___

## Code

    from steem import Steem
    steem = Steem(node="wss://node.steem.ws") #issues with this.piston.rocks atm
    from steem.account import Account
    from steem.amount import Amount

    account = Account("felixxx")

    reward_sum = 0

    for event in account.history(filter_by='curation_reward'): 
        reward = Amount(event['reward']).amount
        link = event['comment_permlink']
        #print(account.converter.vests_to_sp(reward), ' SP for ', link)
        reward_sum += reward

    print('reward (in vest): ', reward_sum)
    reward_sum = account.converter.vests_to_sp(reward_sum)
    print('reward (in sp): ', reward_sum)

    curation = (account.export()['curation_rewards']/1000)
    print('curation according to Account.export (in sp): ', curation)

## Result

http://i.imgur.com/EdgBgdD.png

### Shouldn't those numbers be identical ?
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 14 others
properties (23)
authorfelixxx
permlinkquestion-about-python-steem-real-curation-rewards
categorypython
json_metadata{"tags":["python","pysteem","python-steem","steemd","curation"],"image":["http://i.imgur.com/EdgBgdD.png"],"app":"steemit/0.1","format":"markdown"}
created2017-01-23 13:05:00
last_update2017-01-23 13:05:00
depth0
children12
last_payout2017-02-23 14:25:54
cashout_time1969-12-31 23:59:59
total_payout_value0.379 HBD
curator_payout_value0.055 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,150
author_reputation220,515,515,553,875
root_title"Question about Python-Steem: real curation rewards ?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id2,320,514
net_rshares6,408,020,816,718
author_curate_reward""
vote details (78)
@ace108 ·
sorry, cannot help don't understand but i'm wondering if you know there's steemsql.com
properties (22)
authorace108
permlinkre-felixxx-question-about-python-steem-real-curation-rewards-20170123t144626964z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2017-01-23 14:40:00
last_update2017-01-23 14:40:00
depth1
children2
last_payout2017-02-23 14:25:54
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_length86
author_reputation1,246,544,653,859,061
root_title"Question about Python-Steem: real curation rewards ?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,321,213
net_rshares0
@felixxx ·
https://steemit.com/steemdata/@furion/introducing-steemdata-a-database-layer-for-steem

Yes, it's great.

I'm not that far, yet, though.
I will have to look into it.
For now, I'm still trying to figure out what I can do just with Python-Steem.
properties (22)
authorfelixxx
permlinkre-ace108-re-felixxx-question-about-python-steem-real-curation-rewards-20170123t144513219z
categorypython
json_metadata{"tags":["python"],"links":["https://steemit.com/steemdata/@furion/introducing-steemdata-a-database-layer-for-steem"],"app":"steemit/0.1"}
created2017-01-23 14:45:12
last_update2017-01-23 14:45:12
depth2
children1
last_payout2017-02-23 14:25:54
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_length243
author_reputation220,515,515,553,875
root_title"Question about Python-Steem: real curation rewards ?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,321,256
net_rshares0
@ace108 ·
OK, i tried to learn python a while back up to some beginner stage but didn't continue. Was hoping this SQL thing will be easier. Trying to figure it out.
properties (22)
authorace108
permlinkre-felixxx-re-ace108-re-felixxx-question-about-python-steem-real-curation-rewards-20170123t145432635z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2017-01-23 14:48:03
last_update2017-01-23 14:48:03
depth3
children0
last_payout2017-02-23 14:25:54
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_length154
author_reputation1,246,544,653,859,061
root_title"Question about Python-Steem: real curation rewards ?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,321,273
net_rshares0
@sigmajin · (edited)
I think its converting your reward in vests  to SP at the current rate vest to SP conversion rate in the first one.

In the second one, its using the SP value of your vests when you actually got the reward.

remember, the SP->vest conversion rate changes over time (though not as much since the hardfork)

So imagine  you got 1M vests worth 100SP when the conversion rate was 1M vests=100SP.  Monest later, the conversion rate is 1Mvests=200SP

Its going to show your reward in vests as 1 million vests.  In the first line, its going to convert that 1M vests at the current rate of 1M vests=200SP.

But on the other line, its going to look at the SP value of the vests when you got them.

EDIT -- missed that felixxx already came up with the same answer
👍  , ,
properties (23)
authorsigmajin
permlinkre-felixxx-question-about-python-steem-real-curation-rewards-20170123t153047614z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2017-01-23 15:30:45
last_update2017-01-23 15:36:33
depth1
children0
last_payout2017-02-23 14:25:54
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_length753
author_reputation35,847,511,233,614
root_title"Question about Python-Steem: real curation rewards ?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,321,536
net_rshares144,297,131,755
author_curate_reward""
vote details (3)
@steevc ·
Seems too big a difference for a rounding error, but do rewards always get rounded down to three decimal places?
properties (22)
authorsteevc
permlinkre-felixxx-question-about-python-steem-real-curation-rewards-20170123t130946429z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2017-01-23 13:09:45
last_update2017-01-23 13:09:45
depth1
children7
last_payout2017-02-23 14:25:54
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_length112
author_reputation1,411,705,335,565,487
root_title"Question about Python-Steem: real curation rewards ?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,320,548
net_rshares0
@felixxx ·
If it's too little it gets rounded down to 0 - Other than that I'm not sure.
👍  
properties (23)
authorfelixxx
permlinkre-steevc-re-felixxx-question-about-python-steem-real-curation-rewards-20170123t131953388z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2017-01-23 13:19:51
last_update2017-01-23 13:19:51
depth2
children6
last_payout2017-02-23 14:25:54
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_length76
author_reputation220,515,515,553,875
root_title"Question about Python-Steem: real curation rewards ?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,320,641
net_rshares25,785,972,657
author_curate_reward""
vote details (1)
@steevc ·
Can you sum up those that would get rounded to nothing? I really want to play with stuff like this, but haven't found time. Posts like this give me ideas.
properties (22)
authorsteevc
permlinkre-felixxx-re-steevc-re-felixxx-question-about-python-steem-real-curation-rewards-20170123t132150617z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2017-01-23 13:21:51
last_update2017-01-23 13:21:51
depth3
children5
last_payout2017-02-23 14:25:54
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_length154
author_reputation1,411,705,335,565,487
root_title"Question about Python-Steem: real curation rewards ?"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id2,320,660
net_rshares0