How to calculate STEEM power from VESTS

in #steemit6 years ago (edited)

Approximately a month ago, I made a post about a Python program I wrote that can tell you the real worth of your Steemit account in BTC and dollars (https://steemit.com/steemit/@hmushtaq/a-python-program-to-calculate-the-real-worth-of-your-steemit-account). This is because the equivalent dollar amount shown in your Steemit wallet is not based on the current price of STEEM and SBD.


image source

However, that program suffers from the problem that you need to feed it the amount of your STEEM and SBD yourself. If you look at the comments in that post, @krenter gave a solution where you can get the total worth by just taking the username as input. However, his approach still doesn't take the STEEM power into account. That is because the json output gives STEEM power in the form of VESTS. For example, in my case, the relevant part comes out like this.

vesting_shares: 1366357.116663 VESTS

So, how can I get my STEEM power from this in the program? Well, its simple, I will additionally just have to crawl the steemd.com page where the value of steem_per_mvests is listed, which is 489.282 at the moment. I am sure that there is also a direct way of getting that value by looking inside the Steemit blockchain, but for the moment this method would do :)

Now to calculate a user's STEEM power, I would simply have to multiply that user's vesting_shares with steem_per_mvests and then divide the product by a million. So, basically the following formula.

vesting_shares * steem_per_mvests / 1e6

In my case, this would be

1366357.116663 * 489.282 / 1e6

Which comes out to be nearly 669 STEEM power, which is also shown by my Steemit wallet.

I'll soon update my Python program to calculate the total worth of a user's account in BTC and fiat (dollars or user's currency of choice), with my program only taking the username as input. Once I finish its implementation, I will post a tutorial of it. So, stay tuned!

Sort:  

Wow. This will be useful for steemians. Great contribution. Carry on your good work sir. Wish you a luck🙂

Thanks man :)

There was a piston lib, which contains different formulas to get values from steemit. I've used it to make my informer for my smart tv

Great man. Can you give the link of your program. I remember that I once tried to use some python based steemit library, but it was a nightmare to install it, and therefore I stopped looking into it.

Python lib you can find here https://github.com/xeroc
and my prog here https://github.com/AnatoliyStrizhak/steemit (its in early dev)

By the way, I made a small fork of your getarbitragerates.py for my own needs(added a stock exchange yobit.net and a couple more things). Thanks for steemtools

Thanks mate. I will check that. And good to know that you found my code useful :)

Thanks for this wonderful expository............ It was really helpful

Thanks man. I didn't know the meaning of expository, and therefore had to google it :)

wonderful man. Actually, I am also from IT Background and work as a full-time Laravel Developer. Loved your post.Followed you.

Thanks man. Good to know that you are a developer too. Following you from now on.

Good information @hmushtaq, thanks for sharing

Thanks for educating How to calculate STEEM power from VESTS :)

This post has received a 9.52% upvote from @msp-bidbot thanks to: @hmushtaq. Delegate SP to this public bot and get paid daily: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP Don't delegate so much that you have less than 50SP left on your account.

You got a 2.07% upvote from @mercurybot courtesy of @hmushtaq!

You just rose by 3.2748% upvote from @therising courtesy of @hmushtaq. Earn 43.8% APR by delegating SP to therising. For more details visit: https://steemit.com/budget/@therising/auto-daily-payout-of-43-8-apr-for-steem-power-delegations-starting-from-500-sp-only-limited-period-offer.

This post has received a 3.16% upvote from @aksdwi thanks to: @hmushtaq.

Coin Marketplace

STEEM 0.28
TRX 0.11
JST 0.034
BTC 66077.75
ETH 3167.77
USDT 1.00
SBD 4.01