Afonso_DiazAverage Unlock Time copy
Updated 2024-11-20
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
›
⌄
with
main as (
select
tx_hash,
block_timestamp,
unlock_timestamp,
account_address as user,
olas_amount,
olas_amount_usd,
datediff('day', block_timestamp, unlock_timestamp) as unlock_days
from
crosschain.olas.ez_olas_locking
where
block_timestamp between '{{ start_date }}' and '{{ end_date }}'
and event_name = 'Deposit'
)
select
case
when unlock_days <= 7 then 'a. 1 days - 1 week'
when unlock_days <= 14 then 'b. 1 week - 2 weeks'
when unlock_days <= 30 then 'c. 2 weeks - 1 month'
when unlock_days <= 90 then 'd. 1 month - 3 months'
when unlock_days <= 180 then 'e. 3 months - 6 months'
when unlock_days <= 364 then 'f. 6 months - 1 year'
else 'g. > 1 year'
end as type,
count(distinct tx_hash) as transactions,
count(distinct user) as users,
sum(olas_amount) as olas_volume
from
main
group by 1
order by 1
QueryRunArchived: QueryRun has been archived