Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions steem/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,11 @@ def sbd_to_rshares(self, sbd_payout):
"""
steem_payout = self.sbd_to_steem(sbd_payout)

props = self.steemd.get_dynamic_global_properties()
total_reward_fund_steem = Amount(props['total_reward_fund_steem'])
total_reward_shares2 = int(props['total_reward_shares2'])

post_rshares2 = (
steem_payout / total_reward_fund_steem) * total_reward_shares2
reward_fund = self.steemd.get_reward_fund()
reward_balance = Amount(reward_fund['reward_balance']).amount
recent_claims = int(reward_fund['recent_claims'])

rshares = math.sqrt(
self.CONTENT_CONSTANT ** 2 + post_rshares2) - self.CONTENT_CONSTANT
return rshares
return int(recent_claims * steem_payout / (reward_balance - steem_payout))

def rshares_2_weight(self, rshares):
""" Obtain weight from rshares
Expand Down