The SteemSTEM script for returning the curation rewards to the delegators is now public
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.
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.
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).