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='ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2'
and ADDRESS in (select voter from tab1)
group by 1