banbannardTrending NFT Projects
Updated 2022-06-12Copy 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 base1 as (select
date_trunc('day', block_timestamp) as day,
sum(price) as vol_usd
from flow.core.fact_nft_sales
where tx_succeeded = 'TRUE'
and day >= '2022-05-09'
and currency != 'A.1654653399040a61.FlowToken'
group by 1),
base2 as (select
date_trunc('day', block_timestamp) as day,
sum(price) as vol_flow
from flow.core.fact_nft_sales
where
tx_succeeded = 'TRUE'
and day >= '2022-05-09'
and currency = 'A.1654653399040a61.FlowToken'
group by 1),
base3 as (select date_trunc('day', timestamp) as day,
avg(price_usd) as price_flow
from flow.core.fact_prices
where day >= '2022-05-09'
group by 1),
base4 as (select a.day,
price_flow * vol_flow as usd_vol_flow
from base2 a
join base3 b
on a.day = b.day)
select a.day,
vol_usd,
usd_vol_flow,
vol_usd + usd_vol_flow as total_vol
from base1 a
Run a query to Download Data