sinahosseinzadehUntitled 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 nft as
(
SELECT
address,
project_name
from optimism.core.dim_labels
WHERE label_type='nft'
),
ep AS
(
SELECT
date_trunc('d',hour) as dt1,
--hour,
--price
avg(price) as eth_price
from optimism.core.fact_hourly_token_prices
where symbol='WETH'
GROUP BY dt1
),
fe as
(
SELECT
date_trunc('d',block_timestamp) as dt2,
count(buyer_address) as buyers,
--sum(buyers) OVER (ORDER BY dt ASC) as cumulative_buyers,
nft_address,
project_name,
-- tokenid,
--currency_symbol,
--eth_price,
sum(price) as daily_volume_eth,
-- daily_volume_eth*eth_price as usd_price,
sum(daily_volume_eth) OVER (partition by nft_address ORDER BY dt2 ASC) as cumulative_volume_eth
-- cumulative_volume_eth*eth_price
FROM optimism.core.ez_nft_sales ns
LEFT JOIN nft on ns.nft_address=nft.address
Run a query to Download Data