shengyi-chiuUntitled Query
Updated 2022-07-16
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
›
⌄
with ud as (with raw as (select block_timestamp as t, VALIDATOR_ADDRESS as va,DELEGATOR_ADDRESS as da, tx_id,AMOUNT/10e5 as amt
from osmosis.core.fact_staking
where
currency='uosmo' and action='undelegate')
select date_trunc('year',t) as date,sum(amt) as vol_undel
from raw group by 1),
d as (
with raw as (select block_timestamp as t, VALIDATOR_ADDRESS as va,DELEGATOR_ADDRESS as da, tx_id,AMOUNT/10e5 as amt
from osmosis.core.fact_staking
where
currency='uosmo' and action='delegate')
select date_trunc('year',t) as date,sum(amt) as vol_del
from raw group by 1 order by 1 desc
)
select d.date as year , vol_del as staked_vol,vol_undel as unstaked_vol
from d inner join ud on ud.date=d.date
--where d.date>='2022-01-01'
order by 1
Run a query to Download Data