steembottracker.com - Improvement curation calculator (Merged)
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:
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.
- 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.
- 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 be the r-shares of the vote i, and the sum of all r-shares until the vote i. The weight curation contribution is determined by:
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:
where is the total payout, is the weight curation contribution of the curator, and t is a value between 0 and 1 that represents the rule of 30 minutes.
(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.
Name | Link |
---|---|
Github repository | https://github.com/MattyIce/bottracker |
Commit | 9077ef6aef39359dc02b2166adf7a4663ddb42ed |
Pull Request and Merge | https://github.com/MattyIce/bottracker/pull/35 |
Web | https://steembottracker.com/curation_calculator.html |
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..
Thank for you..
@steemjet..
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!
Your welcome @yabapmatt
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.