jackguyCosmos & Delegation 3
Updated 2022-12-14Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
›
⌄
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