NavidCopy of Copy of Copy of Untitled Query
Updated 2022-10-26Copy 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
›
⌄
with prices as (
select
date(TIMESTAMP) as day,
TOKEN_CONTRACT,
avg(PRICE_USD) as price_usd
from
flow.core.fact_prices
group by
day, TOKEN_CONTRACT
), nft_sales as (
select
block_timestamp as day,
-- split(nft_collection, '.')[2] as collection,
nft_collection as collection,
NFT_ID,
TX_ID,
PRICE*PRICE_USD as volume,
BUYER,
SELLER
from
flow.core.ez_nft_sales a join prices b on a.currency=b.TOKEN_CONTRACT and date(a.block_timestamp)=b.day
)
select
count(distinct collection) as number_of_collections,
count(distinct nft_id) as number_of_nfts,
count(distinct BUYER) as number_of_buyers,
count(distinct SELLER) as number_of_sellers,
count(distinct TX_ID) as tx_count,
sum(volume) as vol
from
nft_sales
Run a query to Download Data