mboveiriMerge Good 2
    Updated 2022-09-29
    with buy as
    (
    select
    date_trunc('day',block_timestamp::date) as date,
    count(origin_from_address) as buyers,
    sum(amount_out) as buy_volume
    from ethereum.core.ez_dex_swaps
    where date >= '2022-08-01'
    and date != current_date
    and symbol_out = 'WETH' and token_out = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    and platform ilike any ('%uniswap%','%sushiswap%')
    group by date
    ),
    sell as (
    select
    date_trunc('day',block_timestamp::date) as date,
    count(origin_from_address) as sellers,
    sum(round(amount_in)) as sell_volume
    from ethereum.core.ez_dex_swaps
    where date >= '2022-08-01'
    and date != current_date
    and symbol_in = 'WETH' and token_in = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    and platform ilike any ('%uniswap%','%sushiswap%')
    group by date
    )

    select
    buy.date,
    buy_volume,
    -sell_volume,
    buyers,
    sellers,
    case when buy.date >= '2022-09-15' then 'After Merge' else 'Before Merge' end as type,
    buy_volume / sell_volume as "% ratio",
    round((buy_volume-sell_volume) * 100.0 / buy_volume, 1) as "% buy_ratio"
    from buy join sell on buy.date = sell.date
    Run a query to Download Data