JonasoFlow : user : dex
    Updated 2024-09-08
    with

    X as( select block_timestamp, trader, tx_id from flow.defi.ez_dex_swaps ),

    A as(
    select date_trunc('month',block_timestamp) as time, count(distinct trader) as nft_trader
    from X
    where year(block_timestamp) = '2024'
    group by 1),

    B as(
    select date_trunc('month',block_timestamp) as times, count(distinct trader) as nft_traders
    from (select trader, min(block_timestamp) as block_timestamp from X group by 1)
    where year(block_timestamp) = '2024'
    group by 1)

    select
    time, nft_trader, nft_traders,
    'DEX active traders' as A,
    'DEX new traders' as B
    from A as a
    left join B as b on a.time = b.times
    order by 1 desc





    QueryRunArchived: QueryRun has been archived