예제 #1
0
 def to_string(self, custom_emoji=None):
     emoji = "💔" if custom_emoji is None else custom_emoji
     price_usd = pretty_number(self.price_usd())
     time_since = time_util.get_minute_diff(self.timestamp)
     message = emoji + " Removed " + pretty_number(self.token_0[1])[0:6] + ' ' + self.token_0[0] + " and " \
               + pretty_number(self.token_1[1])[0:6] + ' ' + self.token_1[0] + " in liquidity" \
               + " <code>($" + price_usd[0:6] + ")</code> " \
               + str(time_since) + " mins ago."
     message += " | " + '<a href="etherscan.io/tx/' + str(
         self.id) + '">view</a>'
     return message
예제 #2
0
 def to_string_complex(self):
     price_usd_raw = self.price_usd()
     price_usd = pretty_number(price_usd_raw)
     emoji = min((round(self.price_usd() / 300)), 30) * "💔" + "💔"
     time_since = time_util.get_minute_diff(self.timestamp)
     first_row = emoji + '\n'
     main_part = "Removed " + pretty_number(self.token_0[1])[0:6] + ' ' + self.token_0[0] + " and " \
                 + pretty_number(self.token_1[1])[0:6] + ' ' + self.token_1[0] + " in liquidity" \
                 + " <code>($" + price_usd[0:6] + ")</code> " \
                 + str(time_since) + " mins ago."
     end = " | " + '<a href="etherscan.io/tx/' + str(self.id) + '">view</a>'
     return first_row + main_part + end
예제 #3
0
 def to_string(self, eth_price):
     if self.token_0[0] == 'WETH':
         price_usd = pretty_number(self.token_0[1] * eth_price)
     else:
         price_usd = pretty_number(self.token_1[1] * eth_price)
     time_since = time_util.get_minute_diff(self.timestamp)
     message = "💔 Removed " + pretty_number(self.token_0[1])[0:6] + ' ' + self.token_0[0] + " and " \
               + pretty_number(self.token_1[1])[0:6] + ' ' + self.token_1[0] + " in liquidity" \
               + " <code>($" + price_usd[0:6] + ")</code> "\
               + str(time_since) + " mins ago."
     message += " | " + '<a href="etherscan.io/tx/' + str(
         self.id) + '">view</a>'
     return message
예제 #4
0
 def to_string(self, eth_price):
     message = ""
     time_since = time_util.get_minute_diff(self.timestamp)
     if self.is_positif():
         price_usd = pretty_number(self.buy[1] * eth_price)
         message += "🟢 Buy  " + pretty_number(self.sell[1])[0:9] + " " + self.sell[0] + " for " \
                    + pretty_number(self.buy[1])[0:9] + " ETH <code>($" + price_usd[0:6] + ")</code> " \
                    + str(time_since) + " mins ago."
     else:
         price_usd = pretty_number(self.sell[1] * eth_price)
         message += "🔴 Sell " + pretty_number(self.buy[1])[0:9] + " " + self.buy[0] + " for " \
                    + pretty_number(self.sell[1])[0:9] + " ETH <code>($" + price_usd[0:6] + ")</code> " \
                    + str(time_since) + " mins ago."
     message += " | " + '<a href="etherscan.io/tx/' + str(
         self.id) + '">view</a>'
     return message
예제 #5
0
 def to_string(self, custom_emoji=None, with_date=True):
     message = ""
     time_since = time_util.get_minute_diff(self.timestamp)
     date_msg = str(time_since) + " mins ago." if with_date else ""
     if self.is_positif():
         price_usd = pretty_number(self.buy[1] * self.paired_with.price_usd)
         emoji = "🟢" if custom_emoji is None else custom_emoji
         message += emoji + " Buy " + pretty_number(self.sell[1])[0:9] + " " + self.sell[0] + " for " \
                    + pretty_number(self.buy[1])[0:9] + " " + self.buy[0] + " <code>($" + price_usd[0:6] + ")</code> " \
                    + date_msg
     else:
         emoji = "🔴" if custom_emoji is None else custom_emoji
         price_usd = pretty_number(self.sell[1] *
                                   self.paired_with.price_usd)
         message += emoji + " Sell " + pretty_number(self.buy[1])[0:9] + " " + self.buy[0] + " for " \
                    + pretty_number(self.sell[1])[0:9] + " " + self.sell[0] + " <code>($" + price_usd[0:6] + ")</code> " \
                    + date_msg
     message += " | " + '<a href="etherscan.io/tx/' + str(
         self.id) + '">view</a>'
     return message