0-MIDdaily and cum new buyers
Updated 2023-04-21
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
›
⌄
with tab1 as (
select ADDRESS
from solana.core.dim_labels
where LABEL like'%lily%'
and LABEL_TYPE='nft'
and LABEL_SUBTYPE='nf_token_contract'
and ADDRESS_NAME like'%lily%'),
tab2 as (
select date_trunc('minute',BLOCK_TIMESTAMP) as time
,SALES_AMOUNT
,MINT
,PURCHASER
,SELLER
from solana.core.fact_nft_sales
where SUCCEEDED='true'),
tab3 as (
select date_trunc('day',time) as day
,PURCHASER
,SALES_AMOUNT
,row_number()over(partition by PURCHASER order by day) as time_row
from tab1
left join tab2
on tab1.ADDRESS=tab2.MINT
where day is not null)
select day
,case
when time_row=1 then 'New Buyers' else 'Old Buyers' end as user_type
,count(PURCHASER) as users
,sum(SALES_AMOUNT) as volume
from tab3
where day>='2023-01-01'
group by 1,2
Run a query to Download Data