with maintable as (
select 'Cosmos' as chain,
voter,
count (distinct tx_id) as Votes_Count,
count (distinct proposal_id) as Proposals_count
from cosmos.core.fact_governance_votes
where tx_succeeded = 'TRUE'
group by 1,2
union ALL
select 'Osmosis' as chain,
voter,
count (distinct tx_id) as Votes_Count,
count (distinct proposal_id) as Proposals_count
from osmosis.core.fact_governance_votes
where tx_succeeded = 'TRUE'
group by 1,2
union ALL
select 'Terra' as chain,
voter,
count (distinct tx_id) as Votes_Count,
count (distinct proposal_id) as Proposals_count
from terra.core.fact_governance_votes
where tx_succeeded = 'TRUE'
group by 1,2)
select *
from maintable
where chain = 'Cosmos'
order by Proposals_count DESC
limit 10