shreexUntitled Query
Updated 2022-07-24
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
with sales as (
select seller,
nft_id,
count(distinct events.tx_id) as sells
from flow.core.fact_nft_sales sales left join flow.core.fact_events events on events.event_contract=sales.nft_collection where nft_collection = 'A.0b2a3299cc857e29.TopShot' and event_type in ('Minted','MomentMinted','Mint','NFTMinted')
GROUP BY 1 ,2
),
buys as (
select buyer,
nft_id,
count(distinct events.tx_id) as buyss
from flow.core.fact_nft_sales sales left join flow.core.fact_events events on events.event_contract=sales.nft_collection where nft_collection = 'A.0b2a3299cc857e29.TopShot' and event_type in ('MomentPurchased','Minted','MomentMinted','Mint','NFTMinted')
GROUP BY 1 ,2 LIMIT 5
)
SELECT
play_type,
sum(sells) as sel,
sum(buyss) as buy,
buy-sel
from buys,sales left join flow.core.dim_topshot_metadata meta on sales.nft_id=meta.nft_id where buys.nft_id=sales.nft_id
GROUP BY 1
Run a query to Download Data