Abolfazl_771025average vesting schedule
Updated 2022-12-31Copy 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
›
⌄
with all_address as(select
address
from terra.core.dim_address_labels
where LABEL_TYPE='defi'
),send as(select
date_trunc('day',block_timestamp) as date1,
sum(AMOUNT)/pow(10,6) as "volume(out)"
from terra.core.ez_transfers
where sender in (select address from all_address)
and CURRENCY='uluna'
group by 1
),receive as(select
date_trunc('day',block_timestamp) as date2,
sum(AMOUNT)/pow(10,6) as "volume(in)"
from terra.core.ez_transfers
where receiver in (select address from all_address)
and CURRENCY='uluna'
group by 1
),table1 as(select
date1,
floor(sum("volume(out)") over (order by date1)) as vol_out
from send
--group by 1
), table2 as(select
date2,
floor(sum("volume(in)") over (order by date2)) as vol_in
from receive
--group by 1
)
select
avg(datediff('day',date2,date1)) as "average vesting schedule"
from table1 join table2 on vol_out = vol_in
where vol_out !=0
Run a query to Download Data