MLDZMNSLA4
Updated 2023-02-14
999
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
›
⌄
--Credit to Jackguy for target chain identification
with t1 as (select
HOUR::date as day,
SYMBOL,
DECIMALS,
avg(PRICE) as token_price
from ethereum.core.fact_hourly_token_prices
group by 1,2,3),
t2 as (select
distinct s.tx_hash,
s.block_timestamp,
'Ethereum' as source_chain,
DECODED_LOG:destinationChain as target_chain,
concat(source_chain,'->',target_chain) as pathway,
SYMBOL as token,
a.origin_from_address as sender,
AMOUNT,
AMOUNT_USD
from ethereum.core.ez_decoded_event_logs s left join ethereum.core.ez_token_transfers a on s.tx_hash=a.tx_hash
where s.CONTRACT_ADDRESS='0x2d5d7d31f671f86c782533cc367f14109a082712'
and s.topics[0] = '0x999d431b58761213cf53af96262b67a069cbd963499fd8effd1e21556217b841'
and a.ORIGIN_TO_ADDRESS='0xce16f69375520ab01377ce7b88f5ba8c48f8d666'
and TX_STATUS='SUCCESS'
--and s.tx_hash='0x815562822b8993b5092fc6a30c6a8de7ab162162d17f75d93ec656c84ac77b8c'
),
t3 as (select
distinct s.tx_hash,
s.block_timestamp,
'Avalanche' as source_chain,
try_hex_decode_string(substr(data, 451, 16)) as target_chain,
concat(source_chain,'->',target_chain) as pathway,
case when d.SYMBOL ilike '%usdc%' then 'USDC' else d.symbol end as token,
Run a query to Download Data