maybeyonassushi_top_growth
    Updated 2021-12-15
    with this_month as (
    select
    date(block_timestamp) as date,
    pool_name,
    sum(amount_usd) as usd_vol
    from ethereum.dex_swaps
    where platform = 'sushiswap'
    and amount_usd is not null
    and amount_usd < pow(10,9)
    and block_timestamp > current_date - interval '30 days'
    group by 1,2
    ),
    growth as (
    select
    date,
    pool_name,
    usd_vol-lag(usd_vol) over (partition by pool_name order by date) as change
    from this_month
    order by change desc
    ),
    pool_growth as (
    select
    pool_name,
    sum(change) as net_growth
    from growth
    where change is not null
    group by 1
    )

    select * from pool_growth
    order by net_growth desc
    limit 10

    -- select * from ethereum.dex_swaps
    -- where pool_name = 'USDT-DVF SLP'
    -- order by amount_usd desc
    Run a query to Download Data