WITH Stakers_CTE AS (
SELECT
tx_from,
MIN(date_trunc('day', block_timestamp)) AS first_occurrence_day
FROM
sei.core.fact_transactions
WHERE msgs[30]:"type"='wasm-silohub/received'
GROUP BY
tx_from
)
SELECT
first_occurrence_day,
COUNT(tx_from) AS total_unique_stakers_first_occurrence,
SUM(COUNT(tx_from)) OVER (ORDER BY first_occurrence_day) AS cumulative_sum
FROM
Stakers_CTE
GROUP BY
first_occurrence_day
ORDER BY
first_occurrence_day;