steembottracker.com - Improvement curation calculator (Merged)

in #utopian-io6 years ago

ext4147.png

Steembottracker.com (by @yabapmatt) has a wonderful tool where we can calculate the curation rewards. This tool shows us how much we will receive if we already voted a post or if we are attempting to vote right now. Additionally, it includes a slider to define hypothetical post payouts, which also influences the curation rewards.

The heart of this calcultor is the following formula:

formula

where P0 is the payout before you vote, P1 is the payout after you vote, v is the value of the vote, PT is the payout after 7 days, and t is a value between 0 and 1 in function to the rule of 30 minutes.

Problem

This formula works very well in most cases, however, it is not perfect, it has 3 problems that I describe below:

  • Downvotes (flags): When a post is downvoted the total payout is decreased and the previous formula is broken (because it is designed only for upvotes). For instance, in this post @grumpycat downvotes @haejin. The calculator shows a negative curation, and it should be zero.

Screenshot_48.jpg

  • Re-upvoting: Steem blockchain has a special rule. When a curator unvotes and votes again he loses the curation rewards, and all this money is distributed among the other curators. For instance, in this post @utopian-io gives a generous upvote, but he received nothing as curation. Why? because he unvoted and voted again.

Screenshot_57.jpg

steembottracker-error-rewards.jpg

  • The square root that the Steem Blockchain uses is an approximation of the real square root (details here). It uses a simple bit to bit operations which reduces a lot the computation and improves the transaction speed. The error of this approximation can go from 0% to 6%, as @crokkon detailed in this post.

Solution

Formula

The best way to calculate the curation rewards is following the same steps that the blockchain uses. Every vote contributes with an amount of r-shares (shares in the reward pool), and the total payout represents the STEEM reserved for the sum of all r-shares of the votes (including negative votes).

Let rsi be the r-shares of the vote i, and RSi the sum of all r-shares until the vote i. The weight curation contribution is determined by:

w

where f(x) is the approximated square root used in Steem. Additionally, if the curator votes within the first 30 minutes of publication part of his earnings go to the author and it is proportional to the remaining time to complete the 30 minutes.

25% of the total payout goes to curators. Each curator receives a percentage of this amount regarding his contribution with respect all curation contributions:

pcurator

where PT is the total payout, wk is the weight curation contribution of the curator, and t is a value between 0 and 1 that represents the rule of 30 minutes.

Then, the above formula is the correct calculation for each curation, and the one I have implemented in the code

(Note that if we assume that there are no downvotes or changes on votes, and that f(x) is the exact square root, then we get the formula shown at the beginning of the post).

Square root

As I mentioned before, the root square used in the Steem Blockchain uses simple bit to bit operations to approximate it. These operations are: OR, AND, SWIFTLEFT, and SWIFTRIGHT. However, it is based on 64-bit numbers and JavaScript only supports bit operations on 32-bit numbers.

For this reason, I coded a set of functions for bit operations on 64-bit numbers in order to implement the same square root used in Steem.

Code

The pull request of this new code was accepted and merged by the owner @yabapmatt.

NameLink
Github repositoryhttps://github.com/MattyIce/bottracker
Commit9077ef6aef39359dc02b2166adf7a4663ddb42ed
Pull Request and Mergehttps://github.com/MattyIce/bottracker/pull/35
Webhttps://steembottracker.com/curation_calculator.html

References

Sort:  

It is a really great tool, thanks. However, I used to use your other tool "Next Vote". Did you decide to disable it? Because I can't use it anymore

Hi @romaincrx. I have to make an update to Next Vote because some parts changed in the bid bot world. Sorry for that. When I fix it I will write you here.

Thank you very much :)

Good morning@gentlebot boss..

Thank you you and most welcome..

Buen trabajo @jga siempre programando cosas útiles para Steemit.

Thanks for the contribution!

Looks very complicated! The quality of your contribution and PR is very high, it's a great example for others - keep up the good work!

A link to the answers of the questionnaire can be found here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you very much @amosbastian for your review :)

Thank you so much @jga, this was a HUGE help!

Hey @jga
Thanks for contributing on Utopian.
We're already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

good post segunda persona que sigo de la tierra de ruben blades

Amigo como siempre usted haciendo cosas de mucho provecho para la comunidad de steemit.
Por cierto después te escribo un memo al privado hay unas personas por allí que me están copiando mi trabajo.

Lo bueno del Blockchain es que nada esta oculto. Y uno puede averiguar quien lo financia.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64303.16
ETH 3137.29
USDT 1.00
SBD 3.97