banbannardOsmosis Roles 3
Updated 2022-07-11Copy Reference Fork
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 base as (select
delegator_address,
sum(amount/pow(10,decimal)) as osmo_entered
from osmosis.core.fact_staking
where blockchain = 'osmosis'
and tx_status = 'SUCCEEDED'
and currency = 'uosmo'
and action in ('redelegate', 'delegate')
group by 1),
base2 as (select
delegator_address,
sum(amount/pow(10,decimal)) as osmo_exited
from osmosis.core.fact_staking
where blockchain = 'osmosis'
and tx_status = 'SUCCEEDED'
and currency = 'uosmo'
and action = 'undelegate'
group by 1),
base3 as (select
delegator_address,
min(block_timestamp) as first_enter
from osmosis.core.fact_staking
where blockchain = 'osmosis'
and tx_status = 'SUCCEEDED'
and amount > 0
and currency = 'uosmo'
and action in ('redelegate', 'delegate')
group by 1),
base4 as (select
a.delegator_address,
sum(amount/pow(10,decimal)) as first_osmo_entered
from osmosis.core.fact_staking a
join base3 b
Run a query to Download Data