Moe1 Selling
    Updated 2022-09-29
    with base as (
    select distinct miner from ethereum.core.fact_blocks
    where BLOCK_TIMESTAMP>='2022-01-01'
    )

    select
    date_trunc(day,block_timestamp)::date as days,
    --case when token_in = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    case when ORIGIN_FROM_ADDRESS in (select miner from base ) then 'Miners' else 'Not-Miners' end as swapper_type,
    count(distinct ORIGIN_FROM_ADDRESS) as tot_swappers,
    count(distinct TX_HASH) as tot_swaps,
    sum(amount_in_usd) as swap_volume,
    avg(amount_in_usd) as avg_swap_volume,
    tot_swaps/tot_swappers as swaps_per_swapper
    from ethereum.core.ez_dex_swaps
    where EVENT_name = 'Swap'
    and block_timestamp between '2022-08-15' and CURRENT_date - 1
    and symbol_out = 'WETH'
    and amount_out_usd > 0 and amount_out_usd is not null
    --and ORIGIN_FROM_ADDRESS in (select miner from base )
    group by 1,2
    Run a query to Download Data