jonestrinhCOSMOS Stake
Updated 2023-01-08Copy 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
29
30
31
32
33
34
35
36
›
⌄
select
dt,
sum(stake) over (order by dt) as amount
from (
select
date_trunc('day', block_timestamp) as dt,
sum(attribute_value / 1e6) as stake
from cosmos.core.fact_msg_attributes
where msg_type = 'delegate'
and attribute_key = 'new_shares'
group by 1
union all
select
date_trunc('day', block_timestamp) as dt,
(-1)*sum(attribute_value / 1e6) as stake
from cosmos.core.fact_msg_attributes
where msg_type = 'unbond'
and attribute_key = 'new_shares'
group by 1
union all
select
date_trunc('day', block_timestamp) as dt,
sum(attribute_value / 1e6) as stake
from cosmos.core.fact_msg_attributes
where msg_type = 'redelegate'
and attribute_key = 'new_shares'
group by 1
union all
select
date_trunc('day', block_timestamp) as dt,
Run a query to Download Data