Exemple #1
0
 def user_summary(self, users, round1=61, round2=None):
     "Summary report on user(s)"
     nmr_usd = nx.token_price_data(ticker='nmr')['price']
     if nx.isstring(users):
         users = [users]
     df = user_summary(self.lb[round1:round2], users, nmr_usd)
     return df
Exemple #2
0
 def earn(self, round1=61, round2=None, ntop=None, use_ints=True):
     "Earnings report"
     nmr_usd = nx.token_price_data(ticker='nmr')['price']
     df = earn(self.lb[round1:round2], nmr_usd)
     df = ntopify(df, ntop)
     if use_ints:
         df = df.round()
         cols = [
             'usd_main', 'usd_stake', 'nmr_main', 'nmr_stake', 'nmr_burn',
             'profit_usd'
         ]
         df[cols] = df[cols].astype(int)
     return df
Exemple #3
0
def stake(df):
    "Earnings report of top stakers"
    price = nx.token_price_data(ticker='nmr')['price']
    t1 = df['round'].min()
    t2 = df['round'].max()
    fmt = "Top stake earners (R{} - R{}) at {:.2f} usd/nmr"
    print(fmt.format(t1, t2, price))
    df = df[['user', 'usd_stake', 'nmr_stake', 'nmr_burn']]
    df = df.groupby('user').sum()
    nmr = df['nmr_stake'] - df['nmr_burn']
    df['profit_usd'] = df['usd_stake'] + price * nmr
    df = df.sort_values('profit_usd', ascending=False)
    df = df.round()
    cols = ['usd_stake', 'nmr_stake', 'nmr_burn', 'profit_usd']
    df[cols] = df[cols].astype(int)
    return df
Exemple #4
0
def top_stakers(round1=61, round2=None, ntop=20):
    "Earnings report of top stakers"
    price = nx.token_price_data(ticker='nmr')['price']
    df = download_leaderboard(round1, round2)
    t1 = df['round'].min()
    t2 = df['round'].max()
    fmt = "Top stake earners (R{} - R{}) at {:.2f} usd/nmr"
    print(fmt.format(t1, t2, price))
    df = df[['user', 'usd_stake', 'nmr_stake', 'nmr_burn']]
    df = df.groupby('user').sum()
    nmr = df['nmr_stake'] - df['nmr_burn']
    df['profit_usd'] = df['usd_stake'] + price * nmr
    df = df.sort_values('profit_usd', ascending=False)
    if ntop < 0:
        df = df[ntop:]
    else:
        df = df[:ntop]
    df = df.round()
    cols = ['usd_stake', 'nmr_stake', 'nmr_burn', 'profit_usd']
    df[cols] = df[cols].astype(int)
    print(df)
Exemple #5
0
def top_earners(round1, round2=None, tournament=1, ntop=20):
    "Report on top earners"
    price = nx.token_price_data(ticker='nmr')['price']
    df = download_leaderboard(round1, round2, tournament=tournament)
    t1 = df['round'].min()
    t2 = df['round'].max()
    fmt = "Top earners (R{} - R{}) at {:.2f} usd/nmr"
    print(fmt.format(t1, t2, price))
    df = df.drop('round', axis=1)
    df = df.groupby('user').sum()
    profit = df['usd_main'] + df['usd_stake']
    nmr = df['nmr_main'] + df['nmr_stake'] - df['nmr_burn']
    profit += price * nmr
    df['profit_usd'] = profit
    df = df.sort_values('profit_usd', ascending=False)
    if ntop < 0:
        df = df[ntop:]
    else:
        df = df[:ntop]
    df = df.round()
    cols = ['usd_main', 'usd_stake', 'nmr_main', 'nmr_burn', 'profit_usd']
    df[cols] = df[cols].astype(int)
    print(df)
Exemple #6
0
 def single_stake_payout(self, round1=61, round2=None):
     "Largest stake payouts"
     nmr_usd = nx.token_price_data(ticker='nmr')['price']
     df = single_stake_payout(self.lb[round1:round2], nmr_usd)
     return df
Exemple #7
0
 def stake(self, round1=61, round2=None, ntop=None):
     "Stake earnings report"
     nmr_usd = nx.token_price_data(ticker='nmr')['price']
     df = stake(self.lb[round1:round2], nmr_usd)
     df = ntopify(df, ntop)
     return df