hrst79asset flow main
Updated 2023-04-30Copy Reference Fork
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 base as(
select
block_timestamp ,
(amount * PRICE) as amount,
case
when from_address = lower('0xEf8801eaf234ff82801821FFe2d78D60a0237F97') then 'Outflow'
when to_address = lower('0xEf8801eaf234ff82801821FFe2d78D60a0237F97') then 'Inlfow'
end as label
from ethereum.core.ez_token_transfers a
join ethereum.core.fact_hourly_token_prices prices
on date_trunc('hour',a.block_timestamp) = prices.hour
and prices.symbol = a.symbol
UNION all
select
block_timestamp,
(amount * PRICE) as amount,
case
when eth_from_address = lower('0xCBD6832Ebc203e49E2B771897067fce3c58575ac') then 'Outflow'
when eth_to_address = lower('0xCBD6832Ebc203e49E2B771897067fce3c58575ac') then 'Inflow'
end as label
from ethereum.core.ez_eth_transfers b
join ethereum.core.fact_hourly_token_prices prices
on date_trunc('hour',b.block_timestamp) = prices.hour
where prices.symbol = 'WETH'
Run a query to Download Data