mys avatar

[SockoBot] Implementation of STEEM vote's value calculator

mys

Published: 10 Jan 2018 › Updated: 10 Jan 2018[SockoBot] Implementation of STEEM vote's value calculator

[SockoBot] Implementation of STEEM vote's value calculator

image.png

Task request

My implementation is referred to task request by jestemkioskiem@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

Leave [SockoBot] Implementation of STEEM vote's value calculator to:

Written by

myś | vote for my witness @mysia

Read more #utopian-io posts


Best Posts From mys

We have not curated any of mys's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From mys