cloudr3nJoepegs Friend Forest - Wallet Age
    Updated 2022-07-31
    -- previous transactions of minters

    -- get list of mint addresses
    with mint_address as (
    select origin_from_address as minter, sum(event_inputs:tokenAmount) as mints
    from avalanche.core.fact_event_logs
    where origin_to_address=lower('0xBCFdD127187eB44e9154Fc17c6157875dCdee6df') and event_name='Mint'
    group by minter),
    tx_list as (
    select count(DISTINCT tx_hash) as no_tx, min(block_timestamp) as earliest_tx_date,
    datediff(day,date(earliest_tx_date),'2022-07-15' ) as date_diff, origin_from_address as wallet_address
    from avalanche.core.fact_event_logs
    group by wallet_address
    )

    select date_diff, count(wallet_address) as wallet_count,
    sum(wallet_count) over (order by date_diff asc) "Cumulative Sum"
    from mint_address
    left join tx_list where minter=wallet_address
    group by date_diff
    order by date_diff asc

    Run a query to Download Data