MLDZMNwlt age
    Updated 2023-10-10
    with t1 as

    (select
    SIGNERS[0] as contributor,
    tx_id,
    block_timestamp

    from solana.core.fact_transactions s
    join (select distinct block_timestamp, tx_id
    from solana.core.fact_events where succeeded = True
    and program_id = 'pAMMTYk2C9tAxenepGk8a1bi9JQtUdnzu3UAh7NxYcW') events
    using(tx_id, block_timestamp)

    ),
    t2 as(
    select
    SIGNERS[0] as users,
    Count(distinct tx_id) as no_txn,
    count (Distinct block_timestamp::Date) as active_days,
    min (block_timestamp) as first_transaction,
    datediff(day,first_transaction,CURRENT_DATE) as wallet_age
    from solana.core.fact_transactions
    where SUCCEEDED='TRUE'
    and SIGNERS[0] in (select contributor from t1)
    and BLOCK_TIMESTAMP>=current_date-120
    group by 1
    )

    select
    case
    when wallet_age<=20 then 'under 20 Days'
    when wallet_age > 20 and wallet_age <= 50 then '20- 50 Days'
    when wallet_age > 50 and wallet_age <= 100 then '50- 100 Days'
    when wallet_age > 100 then 'over 100 Days'
    end as gp,
    count(distinct users) as no_users
    Run a query to Download Data