tkvresearchTelegram Bots I TK Research
    Updated 2023-11-30
    WITH

    L AS ( select * from (VALUES
    ( '🤖 Trading bot' , 'UniBot' , 'UNIBOT' , '0xf819d9cb1c2a819fd991781a822de3ca8607c3c9'),
    ( '🤖 Trading bot' , 'Banana Gun' , 'BANANA' , '0x38e68a37e401f7271568cecaac63c6b1e19130b4'),
    -- ( '🤖 Trading bot' , 'ChainGPT' , 'CGPT' , '0x9840652dc04fb9db2c43853633f0f62be6f00f98'),
    ( '🤖 Trading bot' , 'DexCheck' , 'DCK' , '0x16faf9daa401aa42506af503aa3d80b871c467a3'),
    ( '🤖 Trading bot' , 'LootBot' , 'LOOT' , '0xb478c6245e3d85d6ec3486b62ea872128d562541'),
    ( '🤖 Trading bot' , 'WagieBot' , 'WAGIEBOT' , '0xd2c869382c7ac9f87ff73548d029d67c0f9dee31'),
    ( '🤖 Trading bot' , 'AimBot' , 'AIMBOT' , '0x0c48250eb1f29491f1efbeec0261eb556f0973c7'),
    ( '🤖 Trading bot' , 'PAAL AI' , 'PAAL' , '0x14fee680690900ba0cccfc76ad70fd1b95d10e16')

    ) as l1(tag, name, symbol, contract) ),


    -- A as( select symbol, token_address, avg(price) as price
    -- from ethereum.price.ez_hourly_token_prices
    -- where date(hour) = date(CURRENT_DATE - interval '1 day')
    -- group by 1,2 ),

    -- price

    BB as( select hour, token_address, price from ethereum.price.ez_hourly_token_prices union all
    select hour, token_address, price from bsc.price.ez_hourly_token_prices),

    B as( select d.symbol, avg(price) as price
    from BB as a
    JOIN L as d on a.token_address = d.contract
    where date(hour) = date(CURRENT_DATE)
    group by 1),

    -- volume
    CC as( select AMOUNT_IN_USD as value, TOKEN_IN as contract, BLOCK_TIMESTAMP from ethereum.defi.ez_dex_swaps union all
    select AMOUNT_OUT_USD as value, TOKEN_OUT as contract, BLOCK_TIMESTAMP from ethereum.defi.ez_dex_swaps union all
    select AMOUNT_IN_USD as value, TOKEN_IN as contract, BLOCK_TIMESTAMP from bsc.defi.ez_dex_swaps union all
    select AMOUNT_OUT_USD as value, TOKEN_OUT as contract, BLOCK_TIMESTAMP from bsc.defi.ez_dex_swaps),
    Run a query to Download Data