Bid Bot Checker

in bitbot •  7 years ago 


I was asked about an easier solution for my bid bot bot.
Here is it:

Bit Bod Checker

Quite self explanatory.
Just add more bots into the list and you will get the output, if it is ok to bid on them.
I included already my bot, @microbot, and @buildawhale for you in it.

import datetime
import time
import os
from dateutil import parser
from steem import Steem
from steem.account import Account
from steem.amount import Amount
print(time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.localtime()),flush=True) 
s = Steem()
botlist = [{'username':'microbot',
            'vote_thr':130, # 144 Minutes bid window, when do you want to place your bet? x Minutes
            'bet_amount':0.01 # Amount to bet on bot in SBD
            },

            {'username':'buildawhale',
            'vote_thr':130,
            'bet_amount':2.5
            }

]
rwl = s.get_reward_fund('post')
rc = int(rwl['recent_claims'])
rb = float(rwl['reward_balance'].split(' ')[0])

for bb in botlist:
    print(bb)
    username = bb['username']
    bet_amount= bb['bet_amount']
    vote_thr = bb['vote_thr']
    now = parser.parse(str(datetime.datetime.utcnow())+' UTC') 
    maccount = Account(username,s)  
    last_vote = parser.parse(maccount['last_vote_time']+' UTC')
    if  now-last_vote > datetime.timedelta(minutes=vote_thr):
        print('It is time to bid on ',username)
    mvs = float(maccount['vesting_shares'].split(' ')[0])+float(maccount['received_vesting_shares'].split(' ')[0])-float(maccount['delegated_vesting_shares'].split(' ')[0])
    mvs1 = mvs * 20000
    click = (mvs1 * rb / rc)
    base_price = s.get_current_median_history_price()["base"]
    fct = Amount(base_price).amount
    
    hrs = maccount.history_reverse(filter_by='transfer')
    total_bid = 0.0
    for x in hrs:
        mytime = parser.parse(x['timestamp']+' UTC')
        if mytime<last_vote:
            break
        if x['to'] == username:
            tr = float(x['amount'].split(' ')[0])
            total_bid += tr

    roi = click*fct*bet_amount/(total_bid+(bet_amount)) 
    print(username,' Bot click is worth: '+str(click*fct)+' SBD')
    print('Currently your invest of '+str(bet_amount)+' SBD would give you a return of '+str(roi)+' SBD')
        

Have fun!:)

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:  

This post has been upvoted for free by @microbot with 0.1%!
Get better upvotes by bidding on me.

This post has been upvoted by @microbot with 6.7%!
Vote for my creator @isnochys as witness!

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by isnochys from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.