Abbas_ra21cosmos #3
Updated 2022-12-14
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 tb1 AS (select
TX_ID,
BLOCK_TIMESTAMP,
label AS "destination validator name",
ATTRIBUTE_VALUE AS "destination validator Address"
from
cosmos.core.fact_msg_attributes inner join cosmos.core.fact_validators on Address=ATTRIBUTE_VALUE
where MSG_TYPE='redelegate' and ATTRIBUTE_KEY='destination_validator'),
tb2 AS (select
TX_ID,
BLOCK_TIMESTAMP,
label AS "source validator name",
ATTRIBUTE_VALUE AS "source validator Address"
from
cosmos.core.fact_msg_attributes inner join cosmos.core.fact_validators on Address=ATTRIBUTE_VALUE
where MSG_TYPE='redelegate' and ATTRIBUTE_KEY='source_validator'),
tb3 AS (select
TX_ID,
BLOCK_TIMESTAMP,
split(attribute_value,'uatom')[0]::numeric / pow(10,6) AS "amount"
from
cosmos.core.fact_msg_attributes
where MSG_TYPE='redelegate' and ATTRIBUTE_KEY='amount'),
tb4 AS (
select
TX_ID,
BLOCK_TIMESTAMP,
attribute_value AS "user Address"
from
cosmos.core.fact_msg_attributes
where MSG_TYPE='message' and ATTRIBUTE_KEY='sender'
),
main AS (select
distinct A.TX_ID,
A.BLOCK_TIMESTAMP,
"user Address",
Run a query to Download Data