Ali3NAverage Number of Swappers' Transactions in Avalanche Chain (Avalanche Pangolin)
    Updated 4 hours ago
    with timetable as (
    select case when '{{TimeFrame}}' = 'Last 7 Days' then 7
    when '{{TimeFrame}}' = 'Last 30 Days' then 30
    when '{{TimeFrame}}' = 'Last 60 Days' then 60
    when '{{TimeFrame}}' = 'Last 90 Days' then 90
    when '{{TimeFrame}}' = 'Last 180 Days' then 180
    when '{{TimeFrame}}' = 'Last 365 Days' then 365
    when '{{TimeFrame}}' = 'All Time' then 5000
    else 5000 end as timeframe),

    maintable as (
    select origin_from_address,
    count (distinct tx_hash) as Swaps_Count
    from avalanche.defi.ez_dex_swaps t1
    join timetable
    where platform = 'pangolin'
    and block_timestamp >= CURRENT_DATE - timeframe
    group by 1),

    agetable as (
    select from_address,
    count (Distinct tx_hash) as TX_Count,
    count (distinct block_timestamp::date) as active_days
    from avalanche.core.fact_transactions
    where from_address in (select distinct origin_from_address from maintable)
    group by 1)

    select round (avg (tx_count)) as Average_TX,
    round (median (tx_count)) as Median_TX,
    round (avg(active_days)) as Average_Active_Days
    from agetable


    Last run: about 4 hours agoAuto-refreshes every 12 hours
    AVERAGE_TX
    MEDIAN_TX
    AVERAGE_ACTIVE_DAYS
    1
    1761519
    1
    13B
    398s