MasiDaily New Vs. Active
    Updated 5 days ago
    with tb1 as ( select block_timestamp,
    tx_hash,
    origin_from_address as swapper,
    pool_name,
    amount_in,
    amount_out,
    amount_in_usd,
    amount_out_usd,
    token_in,
    token_out,
    platform,
    symbol_in,
    symbol_out,
    case when amount_in_usd is null then amount_out_usd else amount_in_usd end as volume_usd
    from avalanche.defi.ez_dex_swaps
    where (token_in = ('0xffff003a6bad9b743d658048742935fffe2b6ed7')
    or token_out = ('0xffff003a6bad9b743d658048742935fffe2b6ed7')))
    ,
    tb2 as ( select min(block_timestamp) as day,
    from_address
    from avalanche.core.fact_transactions
    group by 2)
    ,
    tb3 as ( select DISTINCT from_address
    from tb2
    where day >= '2024-01-15')

    select trunc(block_timestamp,'day') as daily,
    case when swapper in (select from_address from tb3) then 'New Address' else 'Active Address' end as type,
    count(DISTINCT swapper) as swappers,
    sum(volume_usd) as volume
    from tb1
    group by 1,2


    Last run: 5 days ago
    DAILY
    TYPE
    SWAPPERS
    VOLUME
    1
    2025-02-21 00:00:00.000New Address10358593798.38
    2
    2025-03-21 00:00:00.000New Address1933884391.94
    3
    2025-03-30 00:00:00.000Active Address61179669.82
    4
    2025-03-05 00:00:00.000New Address16549314757.23
    5
    2025-04-02 00:00:00.000New Address1763368408.24
    6
    2025-01-15 00:00:00.000Active Address5851957566.76
    7
    2025-03-18 00:00:00.000Active Address107343739.25
    8
    2025-02-07 00:00:00.000New Address11159334830.38
    9
    2025-04-21 00:00:00.000New Address13692784030.63
    10
    2025-03-21 00:00:00.000Active Address98428043.15
    11
    2025-03-22 00:00:00.000New Address1373824372.48
    12
    2025-02-18 00:00:00.000New Address101514474375.68
    13
    2025-04-13 00:00:00.000Active Address84501143.08
    14
    2025-02-27 00:00:00.000Active Address3551321451.95
    15
    2025-03-15 00:00:00.000Active Address98339481.7
    16
    2025-04-17 00:00:00.000New Address6472157415.75
    17
    2025-02-26 00:00:00.000Active Address2141694587.41
    18
    2025-03-26 00:00:00.000New Address2244143043.94
    19
    2025-04-04 00:00:00.000New Address5493052956.3
    20
    2025-02-02 00:00:00.000New Address15739142829.84
    ...
    196
    11KB
    42s