LTirrellunflattened_wallets mhm
    Updated 2022-03-15
    with by_date as (SELECT
    COUNT(DISTINCT(tx_from[0]::string)) as unique_users, block_timestamp::date as date
    FROM
    (SELECT
    tx_from[0]::string as user, MIN(block_timestamp) AS first_tx_time
    FROM
    terra.transactions
    GROUP BY user
    ) AS first_tx
    INNER JOIN
    terra.transactions as transactions
    ON
    transactions.tx_from[0]::string = first_tx.user AND
    transactions.block_timestamp = first_tx.first_tx_time
    WHERE block_timestamp::date >= current_date - 90
    group by 2
    order by 2)
    SELECT
    sum( unique_users)
    from by_date


    Run a query to Download Data