-- forked from Top Stargate Voters on Snapshot by number of votes @ https://flipsidecrypto.xyz/edit/queries/5742b3b3-97fa-49e4-91c5-b1add72e1c88
WITH proposals AS (
SELECT
*
FROM
external.snapshot.fact_proposals
WHERE
space_id = 'stgdao.eth'
)
SELECT
voter,
SUM(voting_power),
COUNT(vote_id)
FROM
external.snapshot.fact_votes v
INNER JOIN proposals p ON p.proposal_id = v.proposal_id
GROUP BY 1
ORDER BY 2 DESC
LIMIT 50