nitsFlipping
Updated 2022-10-20Copy 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
30
31
32
33
34
35
36
›
⌄
with a as
(SELECT block_timestamp as bt, nft_collection as nc, nft_id as nid, buyer as b from flow.core.fact_nft_sales ),
flow as
( SELECT count(*) as total_instances, sum(in_a_day) as total_in_a_day, sum(in_a_week) as total_in_a_week,
total_in_a_week/total_instances*100 as percent_in_a_week,
total_in_a_day/total_instances*100 as percent_in_a_day,
sum(in_a_month) as total_in_a_month,
total_in_a_month/total_instances *100 as percent_in_a_month,
'flow' as chain
from
(SELECT *, case when timestampdiff(sql_tsi_hour, bt, block_timestamp) < 24 then 1 else 0 end as in_a_day,
case when timestampdiff(sql_tsi_hour, bt, block_timestamp) < 24*7 then 1 else 0 end as in_a_week,
case when timestampdiff(sql_tsi_hour, bt, block_timestamp) < 24*30 then 1 else 0 end as in_a_month
from flow.core.fact_nft_sales
inner join a
on block_timestamp > bt and nft_collection = nc and nft_id = nid and b= seller) ),
e as
(SELECT block_timestamp as bt, nft_address as na, tokenid as tid, buyer_address as b from ethereum.core.ez_nft_sales) ,
eth as
(SELECT count(*) as total_instances, sum(in_a_day) as total_in_a_day, sum(in_a_week) as total_in_a_week,
total_in_a_week/total_instances*100 as percent_in_a_week,
total_in_a_day/total_instances*100 as percent_in_a_day,
sum(in_a_month) as total_in_a_month,
total_in_a_month/total_instances *100 as percent_in_a_month,
'eth' as chain
from
(SELECT *, case when timestampdiff(sql_tsi_hour, bt, block_timestamp) < 24 then 1 else 0 end as in_a_day,
case when timestampdiff(sql_tsi_hour, bt, block_timestamp) < 24*7 then 1 else 0 end as in_a_week,
case when timestampdiff(sql_tsi_hour, bt, block_timestamp) < 24*30 then 1 else 0 end as in_a_month from ethereum.core.ez_nft_sales
inner join e
on block_timestamp > bt and nft_address = na and tokenid = tid and b = seller_address )),
s as
(SELECT block_timestamp as bt, purchaser as b, mint as m from solana.core.fact_nft_sales ) ,
sol as
(SELECT count(*) as total_instances, sum(in_a_day) as total_in_a_day, sum(in_a_week) as total_in_a_week,
total_in_a_week/total_instances*100 as percent_in_a_week,
Run a query to Download Data