jackguyCosmos & Delegation 3
    Updated 2022-12-14
    WITH tab1 as (
    SELECT
    DISTINCT tx_id
    FROM cosmos.core.fact_msgs
    WHERE MSG_TYPE IN ('redelegate')
    --LIMIT 100
    )

    SELECT *,
    sum(new_users) over (ORDER BY min_day) as cume_users

    FROM (
    SELECT
    min_day,
    count(*) as new_users

    FROM (
    SELECT
    attribute_value,
    min(date_trunc('day', block_timestamp)) as min_day
    FROM cosmos.core.fact_msg_attributes
    WHERE tx_id in (SELECT * from tab1)
    AND attribute_key LIKE 'sender'
    GROUP BY 1
    )
    GROUP BY 1
    )
    order by min_day desc
    Run a query to Download Data