Code optimizations for scotbot

in steem-engine •  6 months ago  (Edited)

As more and more posts were created that have at least one of the scot tags included, my previous scotbot implementation was not efficient anymore.

I rewrote the part that handles the all pending rshares and the token reward pool. In order to show the pending token rewards for one posts, I need to know the current reward pool size and the sum of all pending rshares of all posts.

As there are currently around 15000 pending posts/comments and 217000 votes on palnet, going everytime through all posts and votes is not very efficient.

The first part of improving this is now completed. The pending token amount for a post is no longer stored directly in the database and calculated directly on request. With this change, it is no longer necessary to change all pending posts/comments objects in the database at every round.

The complete sum of all rshares and the current reward pool can be received from the API:
https://scot-api.steem-engine.com/info?token=PAL
with the parameter pending_rshares and reward_pool. pending_rshares includes the author nonlinear curve.
The reward_pool is stored as integer, the token amount can be calculated by dividing it through 10**precision.

Every posts has now a vote_rsharesparameter, which is the sum of all vote rshares. The nonlinear author curve exponent is also stored in every posts with theauthor_curve_exponent parameter. The vote_rsharesparameter and the global pending_rshares are updated whenever a new vote arrives.

The pending token amount can then be calculated on request by:

pending_token = int_pow(vote_rshares, author_curve_exponent) / pending_rshares * reward_pool / 10**precision

Blacklisted accounts

Whenever the @steemsc accounts mutes an account, this account will be blacklisted from all SCOT instances. A blacklisted account can not vote and can only post once a day.

Currently, only animalcontrol is muted by steemsc.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Love your work, Holger. You're an absolute machine, and the chain wouldn't be the same without your incredible efforts.

🤗 Cheers and !BEER 🍻

To view or trade BEER go to steem-engine.com.

Hey @mattclarke, here is your BEER token. Enjoy it!

  ·  6 months ago Reveal Comment

Thanks for the update. Any plan on open source Scotbot? and seems there is a problem on paid out posts now. Number doesn't match with actual payout.

Thank you so much for participating in 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.217 which ranks you at #55 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 175 contributions, your post is ranked at #2. Congratulations!

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

Feel free to join our @steem-ua Discord server

Hi, @holger80!

You just got a 3.62% 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.

great work and appreciated!

I never understand anything holger writes, but it sounds great!

@holger80, Your efforts are really appreciable. We know this is new step and there are so many changes to do to bring the Stability. Keep up and my good wishes are with you.

Posted using Partiko Android