StangFAST04 - age wallet
    Updated 2023-08-14
    -- forked from 03 - new users @ https://flipsidecrypto.xyz/edit/queries/140c57f2-6694-42fc-8b64-91d7ee514043

    -- forked from 01 - overview @ https://flipsidecrypto.xyz/edit/queries/f9894e11-25d2-4fff-ae15-9eb729d9334d

    with

    tab1 AS
    (
    SELECT
    min( a.block_timestamp ) AS min_date1
    , a.tx_signer AS new_user1
    FROM
    near.core.fact_transactions a
    WHERE
    a.tx_receiver LIKE '%sweat%'
    -- AND a.block_timestamp::date > dateadd( 'day' , -{{days}} , current_date )
    -- AND a.block_timestamp::date < dateadd( 'day' , -1 , current_date )
    AND a.tx_status = 'Success'
    GROUP BY 2
    ORDER BY 1 DESC
    )
    ,
    tab2 AS
    (
    SELECT
    min( a.block_timestamp ) AS min_date2
    , a.tx_signer AS new_user2
    , b.min_date1 AS min_date3
    FROM
    near.core.fact_transactions a
    JOIN
    tab1 b
    ON a.tx_signer = b.new_user1
    WHERE
    a.block_timestamp::date > dateadd( 'day' , -{{days}} , current_date )
    AND a.block_timestamp::date < dateadd( 'day' , -1 , current_date )
    Run a query to Download Data