Soheil_MKUntitled Query
Updated 2022-12-11
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
›
⌄
with redel as (
select
distinct tx_id
from cosmos.core.fact_msg_attributes
where MSG_TYPE ='redelegate'
),
source_valid as (
select
BLOCK_TIMESTAMP,
tx_id,
ATTRIBUTE_VALUE as voter
from cosmos.core.fact_msg_attributes
where tx_id in (select tx_id from redel)
and MSG_TYPE='redelegate'
and ATTRIBUTE_KEY ='source_validator'
and BLOCK_TIMESTAMP>='2022-11-14 03:03:04'
),
destination_valid as (
select
BLOCK_TIMESTAMP,
tx_id,
ATTRIBUTE_VALUE as voter
from cosmos.core.fact_msg_attributes
where tx_id in (select tx_id from redel)
and MSG_TYPE='redelegate'
and ATTRIBUTE_KEY ='destination_validator'
and BLOCK_TIMESTAMP>='2022-11-14 03:03:04'
)
select
--BLOCK_TIMESTAMP::date as date,
CASE
when a.voter ='cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0' then '1-stake.fish'
when a.voter ='cosmosvaloper1c4k24jzduc365kywrsvf5ujz4ya6mwympnc4en' then '2-Coinbase Custody'
Run a query to Download Data