You are viewing a single comment's thread from:

RE: steem-python for dummies #8 - Calculating post rewards

in #utopian-io6 years ago

Hi
I'm porting "Post Reward" algorithm to android. I'm using SteemJ.
My problem is that the results were 1 000 000 times bigger than showing by Steemit page.

val steemJ = SteemJ()
val blog = steemJ.getBlog(AccountName("..."), 0, 10.toShort() )
val rewardFund = steemJ.getRewardFund(RewardFundType.POST)
val rewardBalance = rewardFund.rewardBalance.amount;
val recentClaims = rewardFund.recentClaims;
val base = steemJ.currentMedianHistoryPrice.base.amount
val foundPerShare = rewardBalance.toFloat() / recentClaims.toFloat()
for (i in blog) {
    val payout = i.comment.voteRshares * foundPerShare * base

}