WITH first_appearances AS (
SELECT
tx_from,
MIN(block_timestamp) AS first_appearance
FROM
lava.core.fact_transactions
WHERE
block_timestamp >= '2024-07-30 12:00:00'
GROUP BY
tx_from
)
SELECT
DATE_TRUNC('day', first_appearance) AS day,
COUNT(*) AS new_wallets,
sum(new_wallets) over (order by day) as unique_wallets
FROM
first_appearances
GROUP BY
DATE_TRUNC('day', first_appearance)