Afonso_DiazUntitled Query
Updated 2023-01-28
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
t1 as (
select
block_timestamp::date as day,
count(distinct tx_id) as staked_count,
sum(amount/1e6) as staked_volume,
sum(staked_count) over (order by day) as cumulative_staked_count,
sum(staked_volume) over (order by day) as cumulative_staked_volume
from osmosis.core.fact_staking
where action = 'delegate'
and tx_succeeded = 1
group by 1
),
t2 as (
select
block_timestamp::date as day,
count(distinct tx_id) as superfluids_count,
sum(split_part(attribute_value, 'gamm/pool/', 1)::int / pow(10, 18)) as superfluid_volume,
sum(superfluids_count) over (order by day) as cumulative_superfluids_count,
sum(superfluid_volume) over (order by day) as cumulative_superfluid_volume
from osmosis.core.fact_msg_attributes
where msg_type = 'superfluid_increase_delegation'
and attribute_key = 'amount'
and tx_succeeded = 1
group by 1
)
select *
from t1 join t2
using(day)
where day >= current_date - interval '6 months'
order by day
Run a query to Download Data