RayyykAre Miners Selling ETH? 2
    Updated 2022-09-29
    with miners as (select miner as miner_address
    from ethereum.core.fact_blocks),

    table_1 as (select date_trunc('day', block_timestamp) as day,
    count(distinct(tx_hash)) as swap_count1,
    sum(amount_in) as eth_volume1,
    count(distinct(origin_from_address)) as miner_count1
    from ethereum.core.ez_dex_swaps
    where symbol_in in ('WETH', 'ETH')
    and amount_in > 0
    and amount_in < 99999999
    and block_timestamp >= current_date - 60
    and origin_from_address in (select miner_address from miners)
    group by 1),

    table_2 as (select date_trunc('day', block_timestamp) as day,
    count(distinct(tx_hash)) as swap_count2,
    sum(amount_out) as eth_volume2,
    count(distinct(origin_from_address)) as miner_count2
    from ethereum.core.ez_dex_swaps
    where symbol_out in ('WETH', 'ETH')
    and amount_out > 0
    and amount_out < 99999999
    and block_timestamp >= current_date - 60
    and origin_from_address in (select miner_address from miners)
    group by 1),

    final1 as (select a.day,
    case
    when a.day >= '2022-09-15 00:00:00.000' then 'Merged'
    when a.day >= '2022-09-08 00:00:00.000' and a.day < '2022-09-15 00:00:00.000' then 'One Week Before Merge'
    when a.day >= '2022-08-15 00:00:00.000' and a.day < '2022-09-08 00:00:00.000' then 'One Month Before Merge'
    else 'Two Months Before Merge'
    end as merge,
    swap_count1 as "ETH Selling Transactions",
    swap_count2 as "ETH Buying Transactions",
    Run a query to Download Data