MLDZMNhack2
    Updated 2022-07-28
    with tb1 as (select
    distinct USER_ADDRESS as whale,
    BALANCE
    from flipside_prod_db.ethereum.erc20_balances
    where CONTRACT_ADDRESS='ETH'
    and BALANCE_DATE=CURRENT_DATE-2
    and LABEL is null
    and AMOUNT_USD>=40000
    group by 1,2
    order by 2 desc
    )
    select
    BLOCK_TIMESTAMP::date as day,
    count(distinct tx_hash) as tx_count,
    count(distinct FROM_ADDRESS) as no_whales,
    sum(ETH_VALUE) as ETH
    from ethereum.core.fact_transactions x join Ethereum.core.dim_labels y on x.TO_ADDRESS= y.address
    where BLOCK_TIMESTAMP between '2022-05-01' and '2022-07-01'
    and FROM_ADDRESS in (select whale from tb1)
    group by 1
    Run a query to Download Data