Automation of Steem Basic Income

in #utopian-io5 years ago (edited)

Repository

https://github.com/holgern/steembasicincome

Steem Basic Income

At the moment 6800 accounts have bought shares or were sponsored by others in the steem basic income program. Upvotes of member posts were handled by manually adjusted steemauto rules. This was a lot of work, as the upvote percentage has to be adjusted whenever the member gains more shares or when the member changes its posting frequency.

The automation scripts handle all these steps by storing a rshares balance for each member. Every 144 minutes, the rshares balance is increased by 80,000,000 rshares for each share. Upvotes of posts from sbi related accounts will also increase the rshares balance. Whenever a member has written a post, it is upvoted by 20% of the rshares balance. The vote rshares are then subtracted from the rshares balance.

The scripts detect when new shares are bought or sponsored. It checks also all incoming delegations. In both cases, the share amount are updated. In the next 144 min cycle, more rshares will be added to the rshares balance. There is no waiting for enrollment anymore.

You can read more here about the Initial Automation Release.

Technology Stack

The scripts are using beem for accessing the STEEM blockchain. Instruction for installation can be found in the readme.

sbi_store_ops_db.py

This scripts stores new account history entries for all sbi accounts in the database for later usage.
All transfer operation of minnowbooster is also stored in the database.

sbi_transfer.py

New transfer and delegate_vesting_shares account operation are loaded from the database and analyzed for new delegations and STEEM transfer of enrolling new sbi shares. The processed transfer ops are stored in the trx database.

sbi_update_member_db.py

Every 144 minutes, this script adds 80,000,000 rshares for each sbi share to all sbi share holders.
The script calculates the total share days which indicates how long the sbi shares are hold. This is used for initially calculating the rshares balance for all accounts.

This script checks also who upvoted posts from sbi accounts (steembasicincome to sbi10) and adds the upvote rshares multiplied by a factor to the balance.

sbi_store_member_hist.py

This script streams all blocks for outgoing votes. The rshares balance is reduced by the rshares value of all outgoing votes.

sbi_update_post_count.py

The last checked member account is selected and the timestamp of its last post and comment is stored in the database.

sbi_stream_post_comment.py

This script fetches new posts and comments from all members and stores them in the database.

sbi_check_delegation.py

New delegations are checked if they are bought through minnowbooster by checking if a transfer to minnowbooster in the same time exists.

bi_upvote_post_comment.py

This script handles all upvotes of member posts/comments. It loads all not already upvoted posts/comments from the database and go throught them. When post was found and the member has a positive rshares balance, an upvote is casted with 20% of the rshares balance. It is automatically selected from which sbi account the upvote will be casted. It is always the sbi account selected that has the most mana and a sufficient high upvote value.

sbi_check_blacklist.py

It is checked if a member is currently blacklisted by buildawhale or by steemcleaners. When this is the case, the member will not be upvoted until the flag is manually cleared or the blacklist state of buildawhale or steemcleaners changes.

Python library steembi

The scripts uses the provided library steembi. The library contains a class for memo parsing and classes for storing and accessing the different databases. The library contains unit tests for memo parsing. It has also a member class, which is used for calculating the share age and avg share age.

Roadmap

In the next release, a comment answer bot will be provided, so that every member can ask the shares amount and how big the next upvote will be.

Then, a confirmation transfer to the share buyer will be added which shows the new shares count.

How to contribute

Please fork the repository and do a pull requests. It is also possible to open a new issue. You will also find help in the discord server.

GitHub Account

https://github.com/holgern

Sort:  

Thank you for your contribution. I know it's so hard to maintain all the 6800 accounts, but you have done a great job - kudos to that. As always the code is of high quality and nothing much to say in that front.

Just one thing, it would be better if you can branch out and create a pull request on the master branch though it's my personal choice to keep master separate from the development branch.


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, @codingdefined! Keep up the good work!

Thank you so much for participating the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.00% upvote! Together, let’s change the world!

Hi @holger80!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 7.269 which ranks you at #66 across all Steem accounts.
Your rank has dropped 2 places in the last three days (old rank 64).

In our last Algorithmic Curation Round, consisting of 215 contributions, your post is ranked at #4.

Evaluation of your UA score:
  • Your follower network is great!
  • The readers appreciate your great work!
  • Good user engagement!

Feel free to join our @steem-ua Discord server

Hi, @holger80!

You just got a 2.74% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hey, @holger80!

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!

Congratulations @holger80! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 4000 as payout for your posts. Your next target is to reach a total payout of 5000

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Support SteemitBoard's project! Vote for its witness and get one more award!

This post has been included in today's SOS Daily News - a digest of all you need to know about the State of Steem.



That’s epic! You guys have proved the use case and SBI has done amazing things for minnows! This automation is really going to free you guys up to be more efficient and innovative! Really home &steembasicincome keeps improving

Posted using Partiko iOS