Ali3NAverage Holding Time of $BONK Token
Updated 2023-01-05Copy 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 maintable as (
select block_timestamp,
tx_from as User1,
sum (amount)*-1 as Volume
from solana.core.fact_transfers
where mint = 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263'
group by 1,2
union ALL
select block_timestamp,
tx_to as User1,
sum (amount) as Volume
from solana.core.fact_transfers
where mint = 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263'
group by 1,2),
finaltable as (
select block_timestamp,
User1,
sum (Volume) as Net_Volume,
sum (Net_Volume) over (partition by User1 order by block_timestamp rows between unbounded preceding and current row) as User_Net_Volume
from maintable
group by 1,2),
table1 as (
select User1,
min (block_timestamp) as Mindate
from finaltable
where User_Net_Volume > 0
group by 1),
table2 as (
select User1,
max (block_timestamp) as Maxdate
from finaltable
Run a query to Download Data