mariya Total Circulating LUNA Delegation rate
Updated 2022-05-18
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
›
⌄
with a as (select date_trunc('day', block_timestamp) as day, sum (event_amount) as amount_delegated
from terra.staking
where action like '%delegate%'
group by 1),
b as(
select date_trunc('day', block_timestamp) as daya, sum (event_amount) as amount_undelegated
from terra.staking
where action like '%undelegate%'
group by 1
),
c as (
select date_trunc('day', date) as dayb, sum (balance) as CS
from terra.daily_balances
where currency like '%LUNA%'
group by 1
)
select a.day, (sum((amount_delegated-amount_undelegated)/cs)*100) as Delegation_Percent
from a
inner join b ON
b.daya=a.day
inner join c
on c.dayb=b.daya
group by 1
Run a query to Download Data