talebimorteza_72Untitled Query
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 DestinationChainT as
( select block_timestamp, tx_id,attribute_value as Destination_Chain
from axelar.core.fact_msg_attributes
where tx_succeeded = 'TRUE'
and attribute_key = 'destinationChain'),
OriginChainT as (
select block_timestamp,
tx_id,
attribute_value as Origin_Chain
from axelar.core.fact_msg_attributes
where tx_succeeded = 'TRUE'
and attribute_key = 'sourceChain'
and tx_id in (select tx_id from DestinationChainT)),
OriginUserT as
(select block_timestamp,tx_id,attribute_value as Origin_User
from axelar.core.fact_msg_attributes
where tx_succeeded = 'TRUE'
and attribute_key = 'sender'and tx_id in (select tx_id from DestinationChainT)),
BridgeT as
(select block_timestamp,tx_id, attribute_value
from axelar.core.fact_msg_attributes
where msg_type = 'coin_spent'
and attribute_index = 1and tx_id in (select tx_id from DestinationChainT)and tx_succeeded = 'TRUE'),
main_table1 as
(select t1.block_timestamp,t1.tx_id,Origin_Chain,Destination_Chain,Origin_User,
Origin_Chain || ' To ' || Destination_Chain as Transfer_Path,
attribute_value as tokenn
from OriginChainT t1 join OriginUserT t2 on t1.tx_id = t2.tx_id and t1.block_timestamp::date = t2.block_timestamp::date
join DestinationChainT t3 on t1.tx_id = t3.tx_id and t1.block_timestamp::date = t3.block_timestamp::date
join BridgeT t5 on t1.tx_id = t5.tx_id and t1.block_timestamp::date = t5.block_timestamp::date),
main_table2 as (