0xHaM-dATOM staking activity copy
Updated 2023-11-28
999
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
›
⌄
-- forked from ATOM staking activity @ https://flipsidecrypto.xyz/edit/queries/d0994eb8-deb6-4c9c-9dcd-734943168915
with msg_list as(
select
tx_id,
block_timestamp,
msg_index,
msg_type,
msg_group,
attribute_value
from cosmos.core.fact_msg_attributes
where
attribute_key = 'amount'
and (
msg_type = 'withdraw_rewards'
or msg_type = 'unbond'
or msg_type = 'delegate'
)
and attribute_value is not null
and attribute_value like '%uatom%'
and block_timestamp >= '2021-12-01'
)
,pruning_msg_list as(
select
tx_id,
block_timestamp,
msg_index,
msg_type,
msg_group,
case
when (attribute_value like '%ibc%') then substr(right(attribute_value, charindex(',', reverse(attribute_value)) -1), 0, position('uatom', right(attribute_value, charindex(',', reverse(attribute_value)) -1))-1)::integer * pow(10,-6)
else substr(attribute_value, 0, position('uatom', attribute_value)-1)::integer * pow(10,-6)
end as amount
Run a query to Download Data