SELECT
DATE_TRUNC('day', BLOCK_TIMESTAMP) AS day,
COUNT(DISTINCT FROM_ADDRESS) AS daily_active_users
FROM
polygon.core.fact_transactions;
WHERE
BLOCK_TIMESTAMP >= DATEADD(DAY, -30, CURRENT_TIMESTAMP())
AND BLOCK_TIMESTAMP <= CURRENT_TIMESTAMP()
GROUP BY
day
ORDER BY
day;