[SockoBot] Implementation of STEEM vote's value calculator

in utopian-io •  7 years ago  (edited)

image.png

Task request

My implementation is referred to task request by @jestemkioskiem, the new SockoBot $vote command functionality.

Today's task request has to do with addition of new functionality to SockoBot - a $vote command that will calculate given user's vote's value and return it as a discord message.

Development

For last days I was learning how STEEM's upvote calculation works. In SockoBot we wanted to achieve the same upvote value estimation like we see under articles. By using Discord command we could estimate how valuable will be our upvote.

image.png

For that all we need is specific user's vests amount, his voting power and current blockchain reward/claims ratio. These all should be multiplied by SBD to dollars exchange rate. Last what I needed was get_current_median_history_price func from Steemit API.

image.png
As You can see the formula is a little complicated. I needed few hours to get to how it should be solved but after utopian.io bugfix #248 contribution I was sure how this is to be done.

SockoBot's command code is very similiar to utopian.io bugfix #248 where I am waiting for approve. They differ only in details:

Screenshots


Command usage: $vote

image.png
SockoBot show user's current Voting power, estimated 100% powered upvote and estimated upvote right now.

EDIT

After tests it turned out that the 100% upvote estimated value is inaccurate for a few percents. Immediately fixed that:

image.png

Links

https://utopian.io/utopian-io/@jestemkioskiem/sockobot-looking-for-implementation-of-vote-s-value-as-a-discord
https://github.com/Jestemkioskiem/steem-sockobot/pull/4
https://github.com/Jestemkioskiem/steem-sockobot/pull/5



Posted on Utopian.io - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Interesting , thanks @mys

good post,, best information

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @mys I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x