mmdrezaAverage Holding Time of Tokens before Selling
Updated 2023-04-27
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 purchase as (
select buyer_address,
nft_address,
tokenid,
min(block_timestamp::date) as purchase_date
from optimism.core.ez_nft_sales t1
where nft_address = lower('0x2831Aa51DE4E3bB318Cf01eAcd8a7FdbB440ac3A')
and price_usd > 0
group by 1,2,3),
sale as (
select seller_address,
t1.nft_address,
t1.tokenid,
min (block_timestamp::date) as sale_date
from optimism.core.ez_nft_sales t1
where nft_address = lower('0x2831Aa51DE4E3bB318Cf01eAcd8a7FdbB440ac3A')
and price_usd > 0
and seller_address in (select buyer_address from purchase)
and tokenid in (select tokenid from purchase)
and nft_address in (select nft_address from purchase)
group by 1,2,3),
finall_tab as (
select datediff (day,purchase_date, sale_date) as holding_time,
buyer_address,
seller_address,
t1.nft_address,
t1.tokenid
from sale t1
join purchase t2
on t1.seller_address = t2.buyer_address
and t1.nft_address = t2.nft_address
and t1.tokenid = t2.tokenid
where holding_Time >= 0)
Run a query to Download Data