MLDZMNwhales
    Updated 2023-04-30
    -- forked from cex_name_sent @ https://flipsidecrypto.xyz/edit/queries/19c64e46-f001-4414-911f-aa018b85f3d3

    with tb1 as(SELECT
    *
    from ethereum.core.dim_labels
    where label_type='cex'
    ),

    wl as (
    select
    ETH_from_ADDRESS as whales
    from ethereum.core.ez_eth_transfers
    where ETH_to_address in (select ADDRESS from tb1)
    and ETH_FROM_ADDRESS not in (select ADDRESS from tb1)
    and amount > 100
    and BLOCK_TIMESTAMP>='2023-04-01'
    )


    select
    date_trunc('day', BLOCK_TIMESTAMP) as date,
    case
    when ETH_from_ADDRESS in (select whales from wl) then 'Whales'
    else 'Regular Users' end as wlts,
    count(distinct tx_hash) as no_transfers,
    count(distinct ETH_FROM_ADDRESS) as no_users,
    sum(AMOUNT) as volume,
    avg(AMOUNT) as avg_volume,
    median(AMOUNT) as med_volume
    from ethereum.core.ez_eth_transfers
    where ETH_to_address in (select ADDRESS from tb1)
    and ETH_FROM_ADDRESS not in (select ADDRESS from tb1)
    and BLOCK_TIMESTAMP>='2023-04-01'
    group by 1,2

    Run a query to Download Data