mlhAverage wallet size (in OSMO)
Updated 2022-12-10Copy 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
›
⌄
select 'Average wallet size (in OSMO) of the people who have changed their vote more than once' as type,
avg (balance/pow(10,decimal)) as OSMO_bal
from osmosis.core.fact_daily_balances
where currency = 'uosmo'
and date = (select max(date)
from osmosis.core.fact_daily_balances
)
and address in (select voter
from (select a.voter,
count (distinct a.tx_id) as votes_count
from (select distinct a.voter,
a.block_timestamp,
a.tx_id,
b.vote_option
from osmosis.core.fact_governance_votes a join (select a.voter,
minvote1,
vote_option
from osmosis.core.fact_governance_votes a join (select voter,
min (block_timestamp) as minvote1
from osmosis.core.fact_governance_votes
where proposal_id in ('82')
and tx_status = 'SUCCEEDED'
group by 1
) b on a.voter = b.voter and a.block_timestamp = b.minvote1
where proposal_id in ('82')
and tx_status = 'SUCCEEDED'
) b on a.voter = b.voter and a.block_timestamp > b.minvote1 and a.vote_option != b.vote_option
where proposal_id in ('82')
and tx_status = 'SUCCEEDED'
) a
group by 1
having votes_count > 1
)
)
UNION ALL
Run a query to Download Data