superflyGeneral table of sales(sal in 24 hours and in week and in month)
Updated 2022-07-18Copy 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
›
⌄
with flow1 as (select seller,min(block_timestamp) as mindate from flow.core.fact_nft_sales group by 1),
flow2 as (select seller,max(block_timestamp) as maxdate from flow.core.fact_nft_sales group by 1),
flow3 as (select case when timestampdiff ('day', W.mindate, b.maxdate) <= 1 then 'Sale in 24 hours'
when timestampdiff ('day', W.mindate, b.maxdate) > 1 and timestampdiff ('day', W.mindate, b.maxdate) <= 7 then 'sale in week'
when timestampdiff ('day', W.mindate, b.maxdate) > 7 and timestampdiff ('day', W.mindate, b.maxdate) <= 31 then 'sale in month'
else 'Holder' end as sales,count (distinct seller) from flow1 W join flow2 b using(seller)group by 1),
sol1 as (select seller,min(block_timestamp) as mindate
from solana.core.fact_nft_sales group by 1),
sol2 as (select seller,max(block_timestamp) as maxdate from solana.core.fact_nft_sales group by 1),
sol3 as (select case when timestampdiff ('day', W.mindate, b.maxdate) <= 1 then 'sale in 24 hours'
when timestampdiff ('day', W.mindate, b.maxdate) > 1 and timestampdiff ('day', W.mindate, b.maxdate) <= 7 then 'sale in week'
when timestampdiff ('day', W.mindate, b.maxdate) > 7 and timestampdiff ('day', W.mindate, b.maxdate) <= 31 then 'sale in month'
else 'Holder' end as sales,count (distinct seller) from sol1 W join sol2 b using(seller) group by 1),
eth1 as (select seller_address,min(block_timestamp) as mindate from ethereum.core.ez_nft_sales group by 1),
eth2 as (select seller_address, max(block_timestamp) as maxdate from ethereum.core.ez_nft_sales group by 1),
eth3 as (select case when timestampdiff ('day', W.mindate, b.maxdate) <= 1 then 'sale in 24 hours'
when timestampdiff ('day', W.mindate, b.maxdate) > 1 and timestampdiff ('day', W.mindate, b.maxdate) <= 7 then 'sale in week'
when timestampdiff ('day', W.mindate, b.maxdate) > 7 and timestampdiff ('day', W.mindate, b.maxdate) <= 31 then 'sale in month'
else 'Holder' end as Sales, count (distinct seller_address)
from eth1 W join eth2 b using(seller_address)group by 1)
select
'FLOW' as blockchain,*
from flow3
UNION all
Select 'SOLANA' as blockchain, *
from sol3
union all
select 'ETHEREUM' as blockchain, *
from eth3
Run a query to Download Data