rajsTopSHots Sales
Updated 2022-07-08Copy 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
›
⌄
with flow_price as
(
SELECT
date_trunc('day', timestamp) as date,
avg(price_usd) as flow_price
from flow.core.fact_prices
where token = 'Flow'
and timestamp >= '2022-05-04'
and timestamp < '2022-06-12'
group by 1
)
SELECT
date_trunc('day', block_timestamp) as date,
count(*) as no_of_txs,
sum(case when currency = 'A.1654653399040a61.FlowToken' then price*flow_price
else price end) as volume_usd
from flow.core.fact_nft_sales s
left join flow_price p
on date_trunc('day', block_timestamp) = date
where block_timestamp >= '2022-05-04'
and block_timestamp < '2022-06-12'
and nft_collection = 'A.0b2a3299cc857e29.TopShot'
group by 1
order by 1, 3 desc
Run a query to Download Data