jackguyCopy of Copy of Untitled Query copy
Updated 2023-02-18
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
›
⌄
-- forked from ad84f4ae-84da-4193-8429-29caea9d9c26
with redelegates as (
select tx_id,
split(ATTRIBUTE_VALUE,'uatom')[0]::numeric/1e6 as Redelegate_Amount
from cosmos.core.fact_msg_attributes
where msg_type = 'redelegate'
and attribute_key = 'amount'
and ATTRIBUTE_VALUE ilike '%uatom%'
and tx_succeeded = 'TRUE'),
redelegators as (
select block_timestamp,
tx_id,
attribute_value as Redelegator
from cosmos.core.fact_msg_attributes
where ATTRIBUTE_KEY= 'spender'
and tx_id in (select tx_id from redelegates)
and tx_succeeded = 'TRUE'),
from_valids as (
select block_timestamp,
tx_id,
attribute_value as Source_Validator
from cosmos.core.fact_msg_attributes
where ATTRIBUTE_KEY= 'source_validator'
and tx_id in (select tx_id from redelegates)
and tx_succeeded = 'TRUE'),
to_valids as (
select block_timestamp,
tx_id,
attribute_value as Destination_Validator
from cosmos.core.fact_msg_attributes
where ATTRIBUTE_KEY= 'destination_validator'
and tx_id in (select tx_id from redelegates)
Run a query to Download Data