Josh956Uniswap POOL eth stats & stuff
    Updated 2023-05-15
    with
    origin as (
    select
    origin_from_address,
    pool_name,
    min(block_timestamp)as min_date
    from ethereum.core.ez_dex_swaps
    where platform like 'uniswap%'
    group by 1,2
    ),

    poolname as (
    select pool_name, count(*) as ct
    from ethereum.core.ez_dex_swaps
    where platform like 'uniswap%'
    group by 1
    order by 2 DESC
    limit 6
    ),

    newusers as (
    select
    date_trunc('month', min_date) as month, pool_name,
    count(distinct origin_from_address) as "new users"
    from origin
    where min_date > '2022-05-01'
    group by 1,2
    ),

    stats as (
    select
    date_trunc('month', block_timestamp) as month, pool_name,
    count(distinct tx_hash) as "TX Count",
    count(distinct origin_from_address) as users,
    sum(amount_in_usd) as "volume usd",
    avg(amount_in_usd) as "average volume usd",
    Run a query to Download Data