eferfanDecentralizing Power 10
Updated 2022-11-03
999
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
34
35
36
›
⌄
WITH Base_Data as (
SELECT
block_timestamp::Date as Date,
tx_id,
validator,
sum(staked) as osmo_staked
FROM (
SELECT
block_timestamp,
tx_id,
REDELEGATE_SOURCE_VALIDATOR_ADDRESS as validator,
(amount / power(10,6))*(-1) as staked
FROM osmosis.core.fact_staking
where currency LIKE 'uosmo'
AND REDELEGATE_SOURCE_VALIDATOR_ADDRESS is not null
union
SELECT
block_timestamp,
tx_id,
validator_address as validator,
CASE WHEN action = 'undelegate' then (amount / power(10,6))*(-1)
else amount/power(10,6) end as staked
FROM osmosis.core.fact_staking
where currency LIKE 'uosmo'
AND REDELEGATE_SOURCE_VALIDATOR_ADDRESS is NULL
)
WHERE staked is not null group by 1,2,3
),
totals as (
SELECT
Date,
sum(osmo_staked) as month_osmo_staked,
sum(month_osmo_staked) over (order by Date)as total_osmo_staked
Run a query to Download Data