sinahosseinzadehUntitled Query
Updated 2022-08-03
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
›
⌄
select count(1) as sales, count(distinct buyer_address) as buyers, sum(price*price_token) as sales_volume_usd
from optimism.core.ez_nft_sales as tb1
join (
select hour::date as date, symbol, avg(price) as price_token
from optimism.core.fact_hourly_token_prices
where symbol in ('OP','ETH')
group by 1,2
union(
select hour::date as date, case when true then 'ETH' end as symbol, avg(price) as price_token
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
group by 1,2
)
) as tb2 on tb1.block_timestamp::date = tb2.date and tb1.currency_symbol = tb2.symbol
Run a query to Download Data