hbd1994Untitled Query
Updated 2022-09-17
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
›
⌄
select
buyer,
count(*) as purchases_count,
sum(usd_amount) as paid_volume,
count(distinct nft_collection) as collections_count
from
(
(with sale as (select
date(BLOCK_TIMESTAMP) as dte,
HOUR(block_timestamp) as time_hour,
minute(block_timestamp) as time_minute,
TX_ID,
BUYER,
NFT_COLLECTION,
MARKETPLACE,
PRICE
from flow.core.ez_nft_sales
where currency = 'A.1654653399040a61.FlowToken'),
price as (select date(TIMESTAMP) as dte1, hour(TIMESTAMP) as hour1,minute(TIMESTAMP) as time_minute1, PRICE_USD as flow_price
from flow.core.fact_prices
where TOKEN_CONTRACT = 'A.1654653399040a61.FlowToken')
select
dte,
TX_ID,
BUYER,
NFT_COLLECTION,
MARKETPLACE,
PRICE,
(PRICE*flow_price) as usd_amount
from sale
inner join price on dte1=dte and time_hour=hour1 and time_minute=time_minute1)
union all
Run a query to Download Data