You are viewing a single comment's thread from:

RE: Daily Steem-Python Challenge #8, Win 1 Steem!

in #contest7 years ago

Cleaned and updated!
There was one pretty big error with how I was calculating voting power. The voting power param set on the account object is your VP at the last time you voted. So you need to do some math with the last vote time to figure out your current real voting power.

def calc_vote_power(account):
    vp = account['voting_power']
    last = datetime.strptime(account['last_vote_time'], "%Y-%m-%dT%H:%M:%S")
    diff = datetime.utcnow().timestamp() - last.timestamp()
    return (vp + 1e4 * diff / 432e3) / 10000

I actually had to find this one by going through the source code for steemnow

Other than that it was just import errors and the like :P

Sort:  

O wow, I didn't know that about voting power! I just sent you the STEEM, congratulations!