WITH FIRST_TRANSACTION AS(
SELECT
tx_from_address as new_user,
min(block_timestamp) as creation_date
FROM
solana.transactions
WHERE succeeded = 'TRUE'
GROUP BY 1
)
SELECT
count(distinct FIRST_TRANSACTION.new_user) as Total_users
FROM
FIRST_TRANSACTION
INNER JOIN solana.transactions t
ON t.tx_from_address = FIRST_TRANSACTION.new_user AND t.block_timestamp > FIRST_TRANSACTION.creation_date AND t.block_timestamp <= FIRST_TRANSACTION.creation_date + INTERVAL '1 DAY'
WHERE
FIRST_TRANSACTION.creation_date >= '2022-02-01'