Пример #1
0
 def text_stake_provides_liq_to_pools(self, address, pools):
     pools = pre(', '.join(pools))
     thor_tx = link(self.thor_explore_address(address), 'viewblock.io')
     bnb_tx = link(self.binance_explore_address(address), 'explorer.binance.org')
     return f'🛳️ {pre(address)}\n' \
            f'поставляет ликвидность в следующие пулы:\n{pools}.\n\n' \
            f"🔍 Explorers: {thor_tx}; {bnb_tx}.\n\n" \
            f'👇 Выберите пул, чтобы получить подробную карточку информаци.'
Пример #2
0
 def text_stake_provides_liq_to_pools(self, address, pools):
     pools = pre(', '.join(pools))
     thor_tx = link(self.thor_explore_address(address), 'viewblock.io')
     bnb_tx = link(self.binance_explore_address(address),
                   'explorer.binance.org')
     return f'🛳️ {pre(address)}\nprovides liquidity to the following pools:\n' \
            f'{pools}.\n\n' \
            f"🔍 Explorers: {thor_tx}; {bnb_tx}.\n\n" \
            f'👇 Click on the button to get a detailed card.'
Пример #3
0
    def notification_text_price_update(self, p: PriceReport, ath=False):
        title = bold('Price update') if not ath else bold(
            '🚀 A new all-time high has been achieved!')

        c_gecko_url = 'https://www.coingecko.com/en/coins/thorchain'
        c_gecko_link = link(c_gecko_url, 'RUNE')

        message = f"{title} | {c_gecko_link}\n\n"
        price = p.fair_price.real_rune_price

        pr_text = f"${price:.3f}"
        btc_price = f"₿ {p.btc_real_rune_price:.8f}"
        message += f"<b>RUNE</b> price is {code(pr_text)} ({btc_price}) now.\n"

        last_ath = p.last_ath
        if last_ath is not None and ath:
            last_ath_pr = f'{last_ath.ath_price:.2f}'
            message += f"Last ATH was ${pre(last_ath_pr)} ({format_time_ago(last_ath.ath_date)}).\n"

        time_combos = zip(('1h', '24h', '7d'),
                          (p.price_1h, p.price_24h, p.price_7d))
        for title, old_price in time_combos:
            if old_price:
                pc = calc_percent_change(old_price, price)
                message += pre(
                    f"{title.rjust(4)}:{adaptive_round_to_str(pc, True).rjust(8)} % "
                    f"{emoji_for_percent_change(pc).ljust(4).rjust(6)}") + "\n"

        fp = p.fair_price
        if fp.rank >= 1:
            message += f"Coin market cap is {bold(pretty_dollar(fp.market_cap))} (#{bold(fp.rank)})\n"

        if fp.tlv_usd >= 1:
            det_link = link(self.DET_PRICE_HELP_PAGE, 'deterministic price')
            message += (
                f"TVL of non-RUNE assets: ${pre(pretty_money(fp.tlv_usd))}\n"
                f"So {det_link} of RUNE is {code(pretty_money(fp.fair_price, prefix='$'))}\n"
                f"Speculative multiplier is {pre(x_ses(fp.fair_price, price))}\n"
            )

        return message.rstrip()
Пример #4
0
    def notification_text_price_update(self, p: PriceReport, ath=False):
        title = bold('Обновление цены') if not ath else bold(
            '🚀 Достигнуть новый исторический максимум!')

        c_gecko_url = 'https://www.coingecko.com/ru/' \
                      '%D0%9A%D1%80%D0%B8%D0%BF%D1%82%D0%BE%D0%B2%D0%B0%D0%BB%D1%8E%D1%82%D1%8B/thorchain'
        c_gecko_link = link(c_gecko_url, 'RUNE')

        message = f"{title} | {c_gecko_link}\n\n"
        price = p.fair_price.real_rune_price

        btc_price = f"₿ {p.btc_real_rune_price:.8f}"
        pr_text = f"${price:.2f}"
        message += f"Цена <b>RUNE</b> сейчас {code(pr_text)} ({btc_price}).\n"

        last_ath = p.last_ath
        if last_ath is not None and ath:
            message += f"Последний ATH был ${last_ath.ath_price:2.f} ({format_time_ago(last_ath.ath_date)}).\n"

        time_combos = zip(('1ч.', '24ч.', '7дн.'),
                          (p.price_1h, p.price_24h, p.price_7d))
        for title, old_price in time_combos:
            if old_price:
                pc = calc_percent_change(old_price, price)
                message += pre(
                    f"{title.rjust(5)}:{adaptive_round_to_str(pc, True).rjust(8)} % "
                    f"{emoji_for_percent_change(pc).ljust(4).rjust(6)}") + "\n"

        fp = p.fair_price
        if fp.rank >= 1:
            message += f"Капитализация: {bold(pretty_dollar(fp.market_cap))} (#{bold(fp.rank)} место)\n"

        if fp.tlv_usd >= 1:
            message += (
                f"TLV (кроме RUNE): ${pre(pretty_money(fp.tlv_usd))}\n"
                f"Детерминистическая цена: {code(pretty_money(fp.fair_price, prefix='$'))}\n"
                f"Спекулятивый множитель: {pre(x_ses(fp.fair_price, price))}\n"
            )

        return message.rstrip()