NakedCollector2023-03-18 04:22 PM
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
›
⌄
with buy as (
select
date_trunc('day', block_timestamp) as day,
sum(amount_usd) as sales
from ethereum.dex_swaps
where token_address = '0x23b608675a2b2fb1890d3abbd85c5775c51691d5'
and direction = 'OUT'
group by day
),
price as (
select
date_trunc('day', hour) as day,
avg(price) as price
from ethereum.token_prices_hourly
where token_address = '0x23b608675a2b2fb1890d3abbd85c5775c51691d5'
group by day
)
select
buy.day as day,
buy.sales as sales_volume,
price.price as socks_price
from buy
inner join price on buy.day = price.day
Run a query to Download Data