Hello. Long time no see. It's been a hectic week.
Look at my blog of follow the trail in the posts. Like a chain. hehehe.
Today we will see how to calculate the worth of a vote, and also all the calls required to make it work.
Step one.
We will get the reward fund.
The json payload will be
{
"id":"40",
"jsonrpc":"2.0",
"method":"get_reward_fund",
"params":["post"]
}
the result will be
Oh my dear lord, look at the amount of steem there is to distribute. Send some here people. heheheh.
Keep this data we will need it later on.
Step 2
We have to get the price history. The witnesses publish it. One of their jobs.
The json payload for the request will be :
{
"id":"40",
"jsonrpc":"2.0",
"method":"get_feed_history",
"params":[]
}
The result is
The base price is what we will need from this. It is 1.936 sbd for one steem at this point in time.
Step 3
In the previous post we had got our blog and within it was this
"active_votes": [
{
"voter": "jonknight",
"weight": 32034,
"rshares": "8397346078",
"percent": 10000,
"reputation": "2536377476524",
"time": "2018-03-13T05:27:06"
}
]
We will take the rshare value from this
The formula
(rshare/recent_claims)*reward_balance
"recent_claims": "439277663884761608",
8397346078/439277663884761608 = 1.911626009785675575512706965123e-8
e-8 means that you have to take the point 8 values down for the real value. My calculator cannot show that so...
the reward_balance is 726571.332 STEEM
you have to cut out STEEM
1.911626009785675575512706965123e-8 * 726571.332 = 0.01388932656215823337420134082575
let us round that for simplicity
0.013889 STEEM.
This vote is worth 0.013889 STEEM right now.
Now multiply this with the base from feed history.
"base": "1.936 SBD"
Omit the SBD
0.013889 * 1.936 = 0.026889104
So the vote is worth 0.026889104 SBD. Now because SBD is Supposed to be pegged at 1 USD they show it as 0.02 dollars. But if you multiply it with the current SBD rate it will increase in USD value.
Awesome right.
Tomorrow we will see how to calculate the value of your vote. It may be shitty like mine. But you got to know what its worth.
Have any questions, ask them in the comments.
PS : We will be watching how much your vote is worth, so don't hold back. heheheheheeh.