KARTODTerra new Users
    Updated 2022-03-12
    with flattened_transactions as (
    select
    t.block_timestamp,
    t.tx_id,
    tx_from as wallet
    from terra.transactions t
    where tx_status = 'SUCCEEDED'
    ),
    Terra_new_wallets_date AS (
    select
    wallet,
    min(block_timestamp) :: date as join_date
    from flattened_transactions
    group by wallet
    having join_date >= '2022-02-01'
    ),
    temp AS (
    SELECT
    join_date AS time,
    COUNT(wallet) AS new_wallets
    FROM Terra_new_wallets_date
    GROUP BY join_date
    )

    SELECT
    time,
    SUM(new_wallets) OVER (ORDER BY time) AS total_new_wallets,
    new_wallets
    FROM temp
    ORDER BY time desc
    Run a query to Download Data