with tab1 as (
select
VOTER
from osmosis.core.fact_governance_votes
where PROPOSAL_ID=394
and TX_SUCCEEDED='TRUE')
select 'VOTER'as type
,avg(BALANCE/pow(10,decimal))as avg
,max(BALANCE/pow(10,decimal))as max
,min(BALANCE/pow(10,decimal))as min
from osmosis.core.fact_daily_balances
where DATE=(select max(date)from osmosis.core.fact_daily_balances)
and CURRENCY='uosmo'
and ADDRESS in (select voter from tab1)
and BALANCE/pow(10,decimal)>=1
group by 1