maybeyonasbico_deposit_dist
Updated 2022-08-30
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
prices as (
select
hour,
case when symbol = 'WETH' then 'ETH' else symbol end as symbol,
price
from ethereum.core.fact_hourly_token_prices
where symbol in (
'WETH','BICO','USDT','USDC'
)
),
deposits as (
select
block_timestamp,
tx_hash,
'0x'|| substr(topics[1],27) as depositor,
'0x'|| substr(topics[2],27) as token_deposited,
case token_deposited
when '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' then 'USDC'
when '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9' then 'USDT'
when '0xa68ec98d7ca870cf1dd0b00ebbb7c4bf60a8e74d' then 'BICO'
when '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' then 'ETH'
end as token,
case token_deposited
when '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9' then 6
when '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' then 6
else 18
end as decimals,
regexp_substr_all(SUBSTR(data, 3, len(data)), '.{64}') AS segmented_data,
ethereum.public.udf_hex_to_int(segmented_data[0]) as chainId,
case chainId
when '1' then 'ETH'
when '10' then 'OPT'
when '56' then 'BSC'
when '137' then 'POL'
when '42161' then 'ARB'
Run a query to Download Data