Afonso_DiazUntitled Query
Updated 2023-01-29
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 t1 as (
select
purchaser as user,
mint,
min(block_timestamp)::date as buy_date
from solana.core.fact_nft_sales
where marketplace = 'exchange art'
and succeeded = 1
group by 1, 2
),
t2 as (
select
seller as user,
mint,
min(block_timestamp)::date as sell_date
from solana.core.fact_nft_sales t2
where marketplace = 'exchange art'
and exists (select * from t1 where t1.user = t2.seller)
and exists (select * from t1 where t1.mint = t2.mint)
and succeeded = 1
group by 1, 2
),
t3 as (
select
user,
datediff (day, buy_date, sell_date) as holded_time,
mint
from t1 join t2
using(mint, user)
)
select
avg (holded_time) as average_holded_time
from t3
Run a query to Download Data