RamaharNFT Purchases Time Difference
Updated 2022-12-19Copy 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 first_t as (select
tx_id,
block_timestamp,
buyer as flow_nft_buyers,
row_number () over (partition by flow_nft_buyers order by block_timestamp asc) as row_number
from flow.core.ez_nft_sales
where block_timestamp::date >= '2022-01-01'),
second_t as (select
tx_id,
block_timestamp,
buyer as flow_nft_buyers,
row_number () over (partition by flow_nft_buyers order by block_timestamp asc) as row_number
from flow.core.ez_nft_sales
where block_timestamp::date >= '2022-01-01'),
time_diff as (select
'Flow' as chains,
a.flow_nft_buyers as nft_buyers,
timediff (hour,a.block_timestamp,b.block_timestamp) as day_difference
from first_t a join second_t b on a.flow_nft_buyers = b.flow_nft_buyers and b.row_number = a.row_number + 1
),
sol_t1 as (
select purchaser,
Min (date_trunc(hour,block_timestamp)) as MinDate,
Max (date_trunc(hour,block_timestamp)) as MaxDate,
count (*) as txs
from solana.core.fact_nft_sales
where block_timestamp >= '2022-01-01'
group by 1 having Min (date_trunc(hour,block_timestamp)) < CURRENT_DATE - 2),
sol_t2 as (
select
'Solana' as chains,
purchaser as nft_buyers,
Run a query to Download Data