boomer77bonded luna vs unbonded
Updated 2021-08-30
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
›
⌄
with total as
(select
date,
max(balance) as total,
balance_type,
currency
from terra.daily_balances
where currency = 'LUNA' AND address != 'terra1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3nln0mh'
group by 1,3,4),
totall as
(select
date, sum(total) as Total_LUNA
from total
group by 1),
bluna as (
select max(balance) as bonded, address_name, address, date
from terra.daily_balances
where address_name = 'bLuna Hub'
group by 2,3,4
order by 4 desc
)
select date_trunc('month', A.date), avg(A.Total_LUNA) as avgtotal, avg(B.bonded) as avgbonded, avgtotal-avgbonded as avgunbonded
from totall A
join bluna B on A.date = B.date
group by 1
order by 1 desc
limit 180