Elprognerd6 - new wallets
    Updated 2023-04-14
    -- forked from 6 - new wallets @ https://flipsidecrypto.xyz/edit/queries/cc0d8aaf-9930-439d-8dee-4a8c47fd991c

    with txs AS (
    SELECT
    x.BLOCK_TIMESTAMP as BLOCK_TIMESTAMP,
    x.TX_ID as tx,
    x.PROPOSER as user,
    y.EVENT_TYPE as type,
    y.EVENT_CONTRACT
    FROM flow.core.fact_transactions x JOIN flow.core.fact_events y ON x.TX_ID = y.TX_ID
    WHERE x.TX_SUCCEEDED = 'true'
    and y.EVENT_CONTRACT is not null
    ),
    t2 as (SELECT
    user,
    min(BLOCK_TIMESTAMP) as date1
    from txs
    GROUP BY 1
    ORDER BY 2)
    SELECT
    date_trunc('month',date1) as date,
    count(DISTINCT user) as "Number of new wallets",
    sum("Number of new wallets") over (order by date) as "cumulative number of new wallets"
    from t2
    GROUP by 1
    ORDER by 1




    Run a query to Download Data