drone-mostafaUntitled Query
Updated 2022-07-12Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
›
⌄
with NBA_nfts as ( select EVENT_CONTRACT from flow.core.dim_contract_labels where contract_name ilike '%TopShot%' group by 1 ),
Top10_during_conference as (
select team, sum (PRICE) as sales_volume from flow.core.fact_nft_sales join flow.core.dim_topshot_metadata using ( NFT_ID )
where block_timestamp::date between '2022-05-17' and '2022-05-30' and NFT_COLLECTION in (select EVENT_CONTRACT from NBA_nfts )
group by 1 order by sales_volume desc limit 5 )
select BLOCK_TIMESTAMP::date as date , team , count (DISTINCT BUYER) as num_Buyers , count (DISTINCT seller) as num_sellers ,
count (DISTINCT tx_id) as num_sales ,sum (num_sales) over (partition by team order by date ) as cum_sales ,
sum (PRICE) as sales_volume ,sum (sales_volume) over (partition by team order by date ) as cum_sales_volume
from flow.core.fact_nft_sales join flow.core.dim_topshot_metadata using ( NFT_ID ) where block_timestamp::date between '2022-05-17' and '2022-05-30'
and NFT_COLLECTION in (select EVENT_CONTRACT from NBA_nfts ) and team in (select team from Top10_during_conference ) and TX_SUCCEEDED = true
group by 1 ,2
Run a query to Download Data