Updated 2023-02-17
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
›
⌄
with
main as (
select
regexp_substr_all(SUBSTR(data, 3, len(data)), '.{64}') as Decoded,
*
from
ethereum.core.fact_event_logs
where
TOPICS[0] = '0x34660fc8af304464529f48a778e03d03e4d34bcd5f9b6f0cfbf3cd238c642f7f'
)
select
block_timestamp,
tx_hash,
ORIGIN_TO_ADDRESS as to_Address,
concat('0x', substr(Decoded[2], 25, 40)) as from_Address,
'Ethereum' as source,
case
when ethereum.public.udf_hex_to_int (Decoded[0])::numeric in ('102', '2') then 'Binance Smart Chain'
when ethereum.public.udf_hex_to_int (Decoded[0])::numeric in ('101', '1') then 'Ethereum'
when ethereum.public.udf_hex_to_int (Decoded[0])::numeric in ('106', '6') then 'Avalanche'
when ethereum.public.udf_hex_to_int (Decoded[0])::numeric in ('109', '9') then 'Polygon'
when ethereum.public.udf_hex_to_int (Decoded[0])::numeric in ('110', '10') then 'Arbitrum'
when ethereum.public.udf_hex_to_int (Decoded[0])::numeric in ('111', '11') then 'Optimism'
when ethereum.public.udf_hex_to_int (Decoded[0])::numeric in ('112', '12') then 'Fantom'
when ethereum.public.udf_hex_to_int (Decoded[0])::numeric in ('151', '51') then 'Metis'
end as destination,
case
when CONTRACT_ADDRESS = lower('0x0faf1d2d3ced330824de3b8200fc8dc6e397850d') then 'DAI'
when CONTRACT_ADDRESS = lower('0x38ea452219524bb87e18de1c24d3bb59510bd783') then 'USDT'
when CONTRACT_ADDRESS = lower('0xfA0F307783AC21C39E939ACFF795e27b650F6e68') then 'FRAX'
when CONTRACT_ADDRESS = lower('0x692953e758c3669290cb1677180c64183cEe374e') then 'USDD'
when CONTRACT_ADDRESS = lower('0xdf0770df86a8034b3efef0a1bb3c889b8332ff56') then 'USDC'
when CONTRACT_ADDRESS = lower('0x101816545F6bd2b1076434B54383a1E633390A2E') then 'ETH'
when CONTRACT_ADDRESS = lower('0x590d4f8A68583639f215f675F3a259Ed84790580') then 'sUSD'
when CONTRACT_ADDRESS = lower('0xE8F55368C82D38bbbbDb5533e7F56AfC2E978CC2') then 'LUSD'
when CONTRACT_ADDRESS = lower('0x9cef9a0b1bE0D289ac9f4a98ff317c33EAA84eb8') then 'MAI'
Run a query to Download Data