HosseinUntitled Query
Updated 2022-11-05
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 list1 as (
select date_trunc('day', hour::date) as date,
symbol,
decimals,
avg(price) as price
from ethereum.core.fact_hourly_token_prices
where symbol = 'USDC' or
symbol = 'DAI' or
symbol = 'USDT' or
symbol = 'WETH' or
symbol = 'WBTC'
group by date, symbol, decimals
),
list2 as (
select date_trunc('day', block_timestamp::date) as date,
tx_hash,
case contract_address
when '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9' then 'USDT'
when '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' then 'USDC'
when '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1' then 'DAI'
when '0x82af49447d8a07e3bd95bd0d56f35241523fbab1' then 'WETH'
when '0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f' then 'WBTC'
end as token_name,
origin_from_address,
event_inputs:value as input_value
from arbitrum.core.fact_event_logs
where (
origin_to_address = '0x3d6ba331e3d9702c5e8a8d254e5d8a285f223aba' or
origin_to_address = '0xb87a436b93ffe9d75c5cfa7bacfff96430b09868'
)
and event_name='Transfer'
and tx_status = 'SUCCESS'
),
gmx_list as (
Run a query to Download Data