Beispiel #1
0
def getRshares(accountname='soteyapanbot'):
    s = steemlib()
    c = Converter()
    account = s.get_account(accountname)
    vests = samount(account['vesting_shares']).amount
    delegated_vests = samount(account['delegated_vesting_shares']).amount
    received_vests = samount(account['received_vesting_shares']).amount
    current_vests = float(vests) - float(delegated_vests) + float(
        received_vests)
    steem_power = c.vests_to_sp(current_vests)
    rshares = c.sp_to_rshares(steem_power)
    return (rshares)
Beispiel #2
0
def getBreakeven():
    s = steemlib()
    c = Converter()
    steemPrice = float(s.get_current_median_history_price()['base'].replace(
        "SBD", "")) / float(
            s.get_current_median_history_price()['quote'].replace("STEEM", ""))
    for i in range(400000, 500000, 1000):
        rshares = c.sp_to_rshares(i)
        claims = getClaims(rshares)
        steemRewards, steemRewardsOld = rwdComp(claims, rshares, i, steemPrice,
                                                s, c)
        if math.fabs(steemRewards - steemRewardsOld) <= 0.001:
            print(steemRewards, steemRewardsOld, i)
            break
    return (steemRewards, steemRewardsOld, i)
Beispiel #3
0
 def current_vote_value(self, *kwargs):
     try:
         kwargs.items()
     except:
         pass
     else:
         for key, value in kwargs.items():
             setattr(self, key, value)
     try:
         self.lastvotetime
     except:
         self.lastvotetime = None
     try:
         self.steempower
     except:
         self.steempower = 0
     try:
         self.voteweight
     except:
         self.voteweight = 100
     try:
         self.votepower
     except:
         self.votepower = 0
     try:
         self.account
     except:
         self.account = None
     if self.account is None:
         self.account = self.mainaccount
     if (self.lastvotetime is None or self.steempower == 0
             or self.votepower == 0):
         self.check_balances(self.account)
     c = Converter()
     self.voteweight = self.util.scale_vote(self.voteweight)
     if self.votepower > 0 and self.votepower < 101:
         self.votepower = self.util.scale_vote(self.votepower)
     else:
         self.votepower = (self.votepower +
                           self.util.calc_regenerated(self.lastvotetime))
     self.vpow = round(self.votepower / 100, 2)
     self.rshares = c.sp_to_rshares(self.steempower, self.votepower,
                                    self.voteweight)
     self.votevalue = self.rshares_to_steem(self.rshares)
     return self.votevalue