NavidUntitled Query
Updated 2022-08-03
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 weth as (
select
date(HOUR) as the_day,
'ETH' as symbol,
avg(PRICE) as price
from
ethereum.core.fact_hourly_token_prices
where symbol='WETH'
group by
the_day, symbol
union all
select
date(HOUR) as the_day,
symbol,
avg(PRICE) as price
from
optimism.core.fact_hourly_token_prices
where symbol='OP'
group by
the_day, symbol
)
select
-- date_trunc('day',block_timestamp) as the_date,
b.ADDRESS_NAME,
sum(a.PRICE*c.price) as "Price USD",
count(distinct TX_HASH) as "Number of Transactions"
-- sum("Price USD") over (partition by b.ADDRESS_NAME order by the_date asc) as "Cumulative Price USD",
-- count("Number of Transactions") over (partition by b.ADDRESS_NAME order by the_date asc) as "Cumulative Number of Transactions"
from
optimism.core.ez_nft_sales a join optimism.core.dim_labels b on a.NFT_ADDRESS=b.ADDRESS join weth c on date(block_timestamp)=c.the_day and a.CURRENCY_SYMBOL=c.symbol
where
PLATFORM_NAME='quixotic'
group by
b.ADDRESS_NAME
-- , the_date
order by
Run a query to Download Data