The SteemSTEM script for returning the curation rewards to the delegators is now public

in #utopian-io5 years ago

As a consequence of a request made by several people, I share below information about the python script used by @steemstem to automatically return, week after week, a fraction of the curation rewards to our delegators.

The source file of the script is available on this github repository.

The script runs on Python version 3 and only requires the beem library.


Inputs


On startup (after executing the script in a shell), the user is first requested to provide the private active key of the account that will pay the delegators. Let's call this account X below.

Second, the Steem account for which the delegation operations must be tracked needs to be given, as well as the percentage of the curation rewards to be returned to the delegators. Let's call this account Y below.

Finally, the number of days (from the present moment) during which the curation rewards must be collected has to be provided.


Algorithm


The scripts begins with getting the list of delegation operations related to the account Y from its creation. For each operation:

  • If the operation concerns a new delegator, the delegated VESTS are stored in a dictionary with the name of the delegator's Steem account. If the moment at which the delegation occurred is within the curation reward period under consideration, the delegation strength is weighted accordingly to the time it was effective.
  • If the operation concerns an already stored delegator and it turns out that the delegation has been reduced, the stored delegation strength is updated to the new value.
  • If the operation concerns an already stored delegator and it turns out that the delegation has been increased, the stored delegation strength is updated. If the moment at which the delegation has been updated is within the curation reward period under consideration, the extra delegation strength is weighted accordingly to the time it was effective (and only the extra VESTS are weighted).

The curation rewards related to the considered period are then extracted and their specified fraction is returned to the delegators proportionally to their delegated stakes. The payments are done from the account X.


Make sure to follow steemstem on steemstem.io, steemit, facebook, twitter, and instagram to always be up-to-date on our latest news and ideas. Please also consider to support the project by delegating to @steemstem for a ROI of 65% of our curation rewards (quick delegation links: 50SP | 100SP | 500SP | 1000SP | 5000SP | 10000SP).

Sort:  
  • A requirements.txt may help to people want to try the app for dependency installation.

  • Instead of creating separate transactions, it would be better to bundle transfer operations into one transaction.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


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

Thank you for your review, @emrebeyler! Keep up the good work!

Thanks for the advice and the review! I will implement that asap (most probably next week)!

Cheers!

This is great.
Thanks for making the script opensource.
I'll definitely make use of it!

Thanks! I will modify it next week, as suggested by emrebeyler.

Hi @lemouth-dev!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @lemouth-dev!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

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

Vote for Utopian Witness!