FatemeTheLadyTop 10 Addresses
    Updated 2023-05-05
    with top_ as
    (select
    origin_from_address as address,
    count(distinct tx_hash) as swaps
    from
    avalanche.core.ez_dex_swaps
    where block_timestamp::date between '{{StartDate}}' and '{{EndDate}}'
    group by 1
    order by 2 desc
    limit 10
    )

    select
    date_trunc('{{Interval}}',block_timestamp) as "TimeStamp",
    --POOL_NAME as "Swap Pairs",
    --PLATFORM as "Platform",
    count(distinct tx_hash) as "Swaps",
    sum(amount_in_usd) as "volume(USD)",
    sum("Swaps") over(order by "TimeStamp" asc) as "cumulative swaps",
    Avg("volume(USD)") over(order by "TimeStamp" asc rows between 6 preceding and current row) "7MA Volume"
    from
    avalanche.core.ez_dex_swaps
    where origin_from_address in (select address from top_)
    and block_timestamp::date between '{{StartDate}}' and '{{EndDate}}'
    group by 1--,2,3
    order by 1 asc

    Run a query to Download Data