tkvresearchexuberant-beige
Updated 2024-11-26
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 full_data as
(
select * from (values
('0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf','cbBTC','Ethereum')
) as l1(address,token_name,chain)
)
,
pre_final_data as
(
select BLOCK_TIMESTAMP,
'Ethereum' as chain,
SYMBOL,
AMOUNT
from ethereum.core.ez_token_transfers
where contract_address in (select lower(address) from full_data)
and from_address = '0x0000000000000000000000000000000000000000'
union all
select BLOCK_TIMESTAMP,
'Ethereum' as chain,
SYMBOL,
-AMOUNT
from ethereum.core.ez_token_transfers
where contract_address in (select lower(address) from full_data)
and to_address = '0x0000000000000000000000000000000000000000'
union all
select BLOCK_TIMESTAMP,
'Base' as chain,
SYMBOL,
AMOUNT
from base.core.ez_token_transfers
where contract_address in (select lower(address) from full_data)