adambalaSaber Locked Over Time
Updated 2022-04-02
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
lock as (
SELECT SIGNER as locker,min(block_timestamp) as date
FROM solana.fact_gov_actions
WHERE (mint) = ('Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1')
and block_timestamp>'2022-01-01' and action='LOCK'
group by 1
),
unlock as (
SELECT SIGNER as unlocker,min(block_timestamp) as dat
FROM solana.fact_gov_actions
WHERE (mint) = ('Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1')
and block_timestamp>'2022-01-01' and action='EXIT'
group by 1
),
sabor as(
select
datediff(day,date,dat) as date_diff,
locker
FROM lock
inner JOIN unlock
ON locker = unlocker
group by date_diff,locker HAVING date_diff >=0
)
select
count(distinct locker) as locker,
case when date_diff BETWEEN 0 and 10 then '0-10 days'
when date_diff BETWEEN 10 and 40 then '10-40 days'
when date_diff BETWEEN 40 and 80 then '40-80 days'
when date_diff BETWEEN 80 and 120 then '80-120 days'
when date_diff BETWEEN 120 and 1200 then 'More than 100 days'
end as days
FROM sabor