JonasoPangolin (1)
    Updated 2024-10-30
    with

    A as(
    select date_trunc('month',block_timestamp) as time,
    'Pangolin' as dex, platform,
    -- case when platform like '%v1%' then 'v1' else 'v2' end as version,
    sum(case when amount_out_usd is not null then amount_out_usd else amount_in_usd end) as volume,
    count(distinct origin_from_address) as active_trader
    from avalanche.defi.ez_dex_swaps
    where year(block_timestamp) = '2024'
    and platform like '%pangolin%'
    group by 1,2,3 ),

    B as(
    select count(distinct origin_from_address) as trader
    from avalanche.defi.ez_dex_swaps
    where year(block_timestamp) = '2024'
    and platform like '%pangolin%' )

    select *, sum(volume) over(order by time) as total, (select trader from B) as trader
    from A
    order by time desc














    QueryRunArchived: QueryRun has been archived