Пример #1
0
    def notification_text_large_tx(self, tx: StakeTx, dollar_per_rune: float,
                                   pool: StakePoolStats, pool_info: PoolInfo):
        msg = ''
        if tx.type == 'stake':
            msg += f'🐳 <b>Whale added liquidity</b> 🟢\n'
        elif tx.type == 'unstake':
            msg += f'🐳 <b>Whale removed liquidity</b> 🔴\n'

        total_usd_volume = tx.full_rune * dollar_per_rune if dollar_per_rune != 0 else 0.0
        pool_depth_usd = pool_info.usd_depth(dollar_per_rune)
        thor_tx = link(self.thor_explore_address(tx.address),
                       short_address(tx.address))
        bnb_tx = link(self.binance_explore_address(tx.address),
                      short_address(tx.address))

        rp, ap = tx.symmetry_rune_vs_asset()

        rune_side_usd = tx.rune_amount * dollar_per_rune
        rune_side_usd_short = short_money(rune_side_usd)
        asset_side_usd_short = short_money(total_usd_volume - rune_side_usd)
        percent_of_pool = pool_info.percent_share(tx.full_rune)

        msg += (
            f"<b>{pretty_money(tx.rune_amount)} {self.R}</b> ({rp:.0f}% = {rune_side_usd_short}) ↔️ "
            f"<b>{pretty_money(tx.asset_amount)} {short_asset_name(tx.pool)}</b> ({ap:.0f}% = {asset_side_usd_short})\n"
            f"Total: <code>${pretty_money(total_usd_volume)}</code> ({percent_of_pool:.2f}% of the whole pool).\n"
            f"Pool depth is <b>${pretty_money(pool_depth_usd)}</b> now.\n"
            f"Thor explorer: {thor_tx} / Binance explorer: {bnb_tx}.")

        return msg
 def kbd_for_addresses(self):
     buttons = []
     for i, addr in enumerate(self.my_addresses):
         data = f'{self.QUERY_VIEW_ADDRESS}:{i}'
         buttons.append(
             InlineKeyboardButton(short_address(addr.address,
                                                begin=10,
                                                end=7),
                                  callback_data=data))
     return InlineKeyboardMarkup(inline_keyboard=grouper(2, buttons))
Пример #3
0
    def notification_text_large_tx(self, tx: StakeTx, dollar_per_rune: float, pool: StakePoolStats,
                                   pool_info: PoolInfo):
        msg = ''
        if tx.type == 'stake':
            msg += f'🐳 <b>Кит добавил ликвидности</b> 🟢\n'
        elif tx.type == 'unstake':
            msg += f'🐳 <b>Кит вывел ликвидность</b> 🔴\n'

        rp, ap = tx.symmetry_rune_vs_asset()
        total_usd_volume = tx.full_rune * dollar_per_rune if dollar_per_rune != 0 else 0.0
        pool_depth_usd = pool_info.usd_depth(dollar_per_rune)
        thor_tx = link(self.thor_explore_address(tx.address), short_address(tx.address))
        bnb_tx = link(self.binance_explore_address(tx.address), short_address(tx.address))
        percent_of_pool = pool_info.percent_share(tx.full_rune)

        return (
            f"<b>{pretty_money(tx.rune_amount)} {self.R}</b> ({rp:.0f}%) ↔️ "
            f"<b>{pretty_money(tx.asset_amount)} {short_asset_name(tx.pool)}</b> ({ap:.0f}%)\n"
            f"Всего: <code>${pretty_money(total_usd_volume)}</code> ({percent_of_pool:.2f}% от всего пула).\n"
            f"Глубина пула сейчас: <b>${pretty_money(pool_depth_usd)}</b>.\n"
            f"Thor обозреватель: {thor_tx} / Binance обозреватель: {bnb_tx}."
        )
Пример #4
0
def bnb_link(bnb_addr, full=False):
    return link(f"https://explorer.binance.org/address/{bnb_addr}",
                bnb_addr if full else short_address(bnb_addr))
Пример #5
0
def eth_link(eth_addr, full=False):
    return link(f"https://etherscan.io/address/{eth_addr}",
                eth_addr if full else short_address(eth_addr))