binhachon101. [Elite] Crypto-Cosmology, Part 1: Wormhole - Popular sources
Updated 2021-11-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 receiving_native_terra_asset as(
select block_timestamp, event_attributes:recipient::string as address, event_attributes:denom::string as symbol, event_attributes:amount::float/1e6 as amount from terra.msg_events
where tx_id in (
select tx_id from terra.msgs where msg_value:contract::string = 'terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf'
and msg_value:execute_msg:submit_vaa is not null
)
and event_type = 'from_contract'
and event_attributes:action::string = 'complete_transfer_terra_native'
and tx_status = 'SUCCEEDED'
),
receiving_wrapped_asset as (
select block_timestamp, event_attributes:recipient::string as address, event_attributes:"1_contract_address"::string as symbol, event_attributes:"0_amount"::float/1e6 as amount from terra.msg_events
where tx_id in (
select tx_id from terra.msgs where msg_value:contract::string = 'terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf'
and msg_value:execute_msg:submit_vaa is not null
)
and event_type = 'from_contract'
and tx_status = 'SUCCEEDED'
and event_attributes:"0_action"::string = 'complete_transfer_wrapped'
),
sending_asset_terra as(
select block_timestamp, msg_value:sender::string as address,
case when msg_value:execute_msg:initiate_transfer:asset:info:native_token:denom::string is not null then msg_value:execute_msg:initiate_transfer:asset:info:native_token:denom::string
when msg_value:execute_msg:initiate_transfer:asset:info:token:contract_addr::string is not null then msg_value:execute_msg:initiate_transfer:asset:info:token:contract_addr::string end as symbol,
msg_value:execute_msg:initiate_transfer:recipient_chain::float as chain_ID,
msg_value:execute_msg:initiate_transfer:asset:amount::float/1e6 as amount, msg_value from terra.msgs
--where tx_id in ('AAADC8C33BF6E4BA2E20D44954F9CC27823F949736340897C8AB7DA682B21087','128EBAB071276F3FFF92E8CE2D59E3FEFD1870CE1B7AE547DC8633F67A7C9F26')
where msg_value:contract::string = 'terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf'
and tx_status = 'SUCCEEDED'
and msg_value:execute_msg:initiate_transfer:recipient_chain is not null
)
select count(tx_id) as total_transactions, count(distinct from_address) as unique_users, 'Polygon' as chain from (
select distinct tx_id, from_address from polygon.udm_events
where to_address = '0x5a58505a96d1dbf8df91cb21b54419fc36e93fde'
and symbol in ('LUNA', 'UST')
Run a query to Download Data