Update on Steem Bot Analysis :SBD and % Upvote View of Bot Upvotes

Words
221
Reading
1 min
Listen
Play
8y

New Features added to Steem Bot Analysis

SteemBotAnalysis is a tool developed to analyze :

  • How old are the posts at the date of upvote
  • According to the chosen bots
  • According to the chosen date

Features added

  • Before

The % upvote and SBD pay-out of the bid-bots were not shown.

  • After

% Upvote field added to see which post have been voted with what % of the bid-bot

image.png

SBD pay-out of the bid-bot also shown to see how much upvote in SBD the post have taken.

image.png

Implementation of the changes

  • Finding the voting percent

Geting the result from the steem.js API call, the percentages are taken from the result array and written in the div.

for (let i = 0; i < all_votes.length; i++) {
          var all_voters = all_votes[i].voter;
          if (all_voters == voter) {
            document.getElementById('vote_Weight').innerHTML = document.getElementById('vote_Weight').innerHTML + " % " + (all_votes[i].percent / 100) + "
"
;
  • Finding the SBD value of the vote

Global properties, current feed price and current reward status are taken with below function.

function calc_global() {
      steem.api.getDynamicGlobalProperties(function(err, result) {        
        steem.api.getFeedHistory(function(err, result2) {
          console.log(err, result2);
          steem.api.getRewardFund('post', function(err, result3) {
            console.log(err, result3);
            var reward_balance = parseFloat(result3.reward_balance.split(" ")[0]);
            var recent_claims = parseFloat(result3.recent_claims);
            var steem_reward_per_vest = (reward_balance / recent_claims);
            calculate_steempov(result, result2, steem_reward_per_vest);

          });
        });
      });
    }

Based on the results of the first function, the SBD power of the current bot at %100 power is calculated with below function.

function calculate_steempov(globals, feed_price, rpv) {
      total_vesting_shares = globals.total_vesting_shares;
      total_vesting_fund_steem = globals.total_vesting_fund_steem;
      feed = feed_price;    
      steem.api.getAccounts([voter], function(err, response) {
        vesting_shares = parseFloat(response[0].vesting_shares.split(' ')[0]);
        delegated_vesting_shares = parseFloat(response[0].delegated_vesting_shares.split(' ')[0]);
        received_vesting_shares = parseFloat(response[0].received_vesting_shares.split(' ')[0]);
        steem_power = (vesting_shares + received_vesting_shares - delegated_vesting_shares);            
        var feed_arr = feed_price.current_median_history.base;
        feed = feed_arr.split(" ")[0];
        max_sbd = (rpv * steem_power * 0.2) * feed * 100000;
      });
    }

variable max_sbd stores the SBD of the bot at %100 voting power.

  • Calculating the SBD of the post

 var sbd_pay = (all_votes[i].percent / 100) * max_sbd;
            document.getElementById('vote_sbd').innerHTML = document.getElementById('vote_sbd').innerHTML + (sbd_pay / 100).toFixed(2) + " SBD" + "
"
;

sbd_pay is found multiplying max_sbd with percent vote.

Links

Steem Bot Analysis : https://fdsteemtools.neocities.org/botanalysis.html
GitHub : https://github.com/firedreamgames/steembotanalysis

Contact

Proof of Work

image.png



Posted on Utopian.io - Rewarding Open Source Contributors

Update on Steem Bot Analysis :SBD and % Upvote View of Bot Upvotes | Ecency