MostlyData_Staking flow (Osmosis)
Updated 2023-04-13
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
34
35
36
›
⌄
with staking_info as(
select
block_timestamp,
tx_id,
action,
delegator_address,
validator_address,
redelegate_source_validator_address,
amount * pow(10,-decimal) as osmo
from osmosis.core.fact_staking
where block_timestamp > current_date() - interval '{{weeks}} week'
),
delegation_info as (
select
date_trunc('week', block_timestamp) as date,
sum(osmo) as delegation
from staking_info
where action = 'delegate'
group by 1
),
undelegation_info as(
select
date_trunc('week', block_timestamp) as date,
sum(osmo) as undelegation
from staking_info
where action = 'undelegate'
group by 1
Run a query to Download Data