mo115Untitled Query
Updated 2022-04-14Copy 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
›
⌄
(with D as(with A as (select PURCHASER, sum(SALES_AMOUNT) as total_amount
from solana.fact_nft_sales
where block_timestamp >= '2022-03-01'
and (MARKETPLACE = 'magic eden v1' or MARKETPLACE = 'magic eden v2')
group by PURCHASER
order by total_amount desc
limit 20)
select DATE_TRUNC('hour', b.block_timestamp) AS time , a.PURCHASER, count (mint) as NFTs, case when NFTs > 10 then 'yes' end as sweep
from A a join solana.fact_nft_sales b on a.PURCHASER=b.PURCHASER
where block_timestamp >= '2022-03-01'
group by 1,2)
select Count(d.sweep)
from D )
union
(with D as(with A as (select PURCHASER, sum(SALES_AMOUNT) as total_amount
from solana.fact_nft_sales
where block_timestamp >= '2022-03-01'
and (MARKETPLACE = 'magic eden v1' or MARKETPLACE = 'magic eden v2')
group by PURCHASER
order by total_amount desc
limit 20)
select DATE_TRUNC('hour', b.block_timestamp) AS time , a.PURCHASER, count (mint) as NFTs, case when NFTs <= 10 then 'no' end as sweep
from A a join solana.fact_nft_sales b on a.PURCHASER=b.PURCHASER
where block_timestamp >= '2022-03-01'
group by 1,2)
select Count(d.sweep)
from D )
Run a query to Download Data