SalehCelsius and Sushi-swaps-sushi-uniswap-Total
    Updated 2022-07-13
    with lst_check as (
    select
    address
    from flipside_prod_db.crosschain.address_labels
    where project_name ='celsius network'
    group by 1
    )
    ,lst_uni2 as (
    select
    pool_name
    ,count (distinct tx_hash) as tx_count
    ,sum(AMOUNT_IN_USD) as sum_amount_usd
    from ethereum.core.ez_dex_swaps
    where origin_from_address in (select address from lst_check)
    group by 1
    having SUM_AMOUNT_USD>0
    order by 1
    )

    ,lst_uni3 as (
    select
    pool_name
    ,count (distinct TX_ID) as tx_count
    ,sum(abs(AMOUNT0_USD)) as sum_amount_usd
    from flipside_prod_db.uniswapv3.swaps
    where RECIPIENT in (select address from lst_check)
    group by 1
    having SUM_AMOUNT_USD>0
    order by 1
    )

    select * from lst_uni2
    union all
    select * from lst_uni3

    Run a query to Download Data