Repository
https://github.com/mcfarhat/actifit
Details
We need to create a Node.js script that handles upvoting and storing relevant ACTIFIT token values, scores and rewards per each user and account that is eligible for reward.
The script's algorithm and technical details would be as follows:
- we need to constantly check the VP of
account, and do the following when VP reaches 100% AND after at least 24 hours of the last voting round:
- go through the actifit posts since the last voting round, and pull all the new actifit (unvoted) posts
- grab post with actifit tag, make sure it contains step_count as part of jsonmetadata and
and
as beneficiaries
- check step_count value, make sure value is at least 5000, otherwise skip it
- check if post was upvoted by a bot, bot list source can be fetched from steembottracker API, if so skip the post.
- compile final list of posts with step_count and current vote value for each
- calculate and distribute VP across posts so that we do not consume more than 20% VP, as follows:
| step_count | rate_multiplier | token_count |
|---|---|---|
| 5,000-5,999 | 0.2 | 20 |
| 6,000-6,999 | 0.35 | 35 |
| 7,000-7,999 | 0.5 | 50 |
| 8,000-8,999 | 0.65 | 65 |
| 9,000-9,999 | 0.8 | 80 |
| 10,000+ | 1 | 100 |
which makes the formula as follows:
no_of_posts_10k+ * x * 1 + no_of_posts_9k * x * 0.8 + no_of_posts_8k * x * 0.65 + no_of_posts_7k * x * 0.5 + no_of_posts_6k * x * 0.35 + no_of_posts_5k * x * 0.2 = 1000
we calculate x, and when upvoting each batch of posts, we need to multiply it by the relevant multiplier. So when upvoting top batch, we multiply x by 1 for each vote, ensuring vote doesn't go beyond 100. Same for following ones.
- In terms of ACTIFIT tokens, those will need to be stored in a database on the same server, as follows:
- when upvoting, we need to check if the user already has an account stored - need two tables:
- user_tokens table: with fields user, total_token_count
- token_transactions table: with fields user, reward_activity (values: post, or other options such as moderation, delegation), post_permalink, date, and token_count. User field will be his steemit account name, and the remaining ones are self-explanatory.
- if user has account, need to increase his token count with the proper amount found in table above, and register a transaction relevant to this. if not, create new account and do same process
- Calculating actifit tokens for upvoters/resteemers:
we also need, for all posts that are being upvoted, to fetch a list of all upvoters and resteemers, those will be rewarded with 1 ACTIFIT token per action (upvote or resteem), and their account value and relevant transactions need to be created for them (reward_activity will be upvote or resteem).
need to have end points for calling the scripts and returning user current token count, along prior transactions per each user
The full process above needs to be done on the first run for all older posts to calculate and store proper ACTIFIT tokens and transactions for users.
Components
The above task is required to allow completing a part of the cycle for tracking and rewarding posts created via the Android app and all persons who should be accordingly rewarded.
Deadline
I would love for this to be completed the soonest, with deadline being on July 4th, 2018
EDIT: I have someone who started working on this. Agreed that deadline for voting part will be July 4th, while the FINAL DEADLINE for full completion will be on July 11th, 2018
Communication
If you have any questions or would like to contact me for further details on the task or on means of cooperation, feel free to reach out:
- on actifit discord
- via discord DM: mcfarhat#6013