MLDZMNFTXvsETH
    Updated 2022-11-23
    with tb1 as(SELECT
    *
    from ethereum.core.dim_labels
    where label ilike '%alameda%'
    or label ilike 'ftx%'
    ),

    tb4 as (select
    HOUR::date as day,
    avg(price) as ETH_price
    from ethereum.core.fact_hourly_token_prices
    where hour>= '2022-11-01'
    and symbol in ('WETH')
    group by 1),

    tb2 as (select
    BLOCK_TIMESTAMP::date as day,
    count(distinct tx_hash) as no_transfer,
    count(distinct ETH_FROM_ADDRESS) as no_sender,
    sum(AMOUNT) as total_volume,
    avg(AMOUNT) as avg_volume,
    sum(total_volume) over (order by day) as cum_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>='2022-11-01'
    group by 1),
    tb3 as (select
    BLOCK_TIMESTAMP::date as day,
    count(distinct tx_hash) as no_transfer1,
    count(distinct ETH_to_address) as no_sender1,
    sum(AMOUNT) as total_volume1,
    avg(AMOUNT) as avg_volume1,
    sum(total_volume1) over (order by day) as cum_volume1
    from ethereum.core.ez_eth_transfers
    Run a query to Download Data