BaseVote table
    Updated 2024-09-13

    with

    a as
    (select
    count(distinct ID) as vote ,
    count(distinct VOTER) as VOTERs ,
    sum(VOTING_POWER) as voting_powers ,
    PROPOSAL_ID as PROPOSAL
    from external.snapshot.ez_snapshot
    where SPACE_ID = 'toshibase.eth'
    group by 4
    )


    select
    distinct PROPOSAL_TITLE as "Proposal Title",
    vote as "Total Votes",
    VOTERs as "Total Voters",
    CASE
    WHEN voting_powers >= 1000000000 THEN ROUND(TO_VARIANT(voting_powers / 1000000000),4) || ' B'
    WHEN voting_powers >= 1000000 THEN ROUND(TO_VARIANT(voting_powers / 1000000),2) || ' M'
    WHEN voting_powers >= 1000 THEN ROUND(TO_VARIANT(voting_powers / 1000),1) || ' K'
    ELSE TO_VARIANT(voting_powers)
    END AS "Voting Powers",
    round(voting_powers/ 420690000000*100,1) as "Voting Power Ratio",
    CHOICES as "Choices",

    datediff('day',PROPOSAL_START_TIME::date,PROPOSAL_END_TIME::date) as "Voting Period",
    PROPOSAL_START_TIME as "Proposal Started",
    PROPOSAL_END_TIME as "Proposal Ended",
    PROPOSAL_TEXT as "Proposal Text",
    'https://snapshot.org/#/toshibase.eth/proposal/'||PROPOSAL_ID as "Proposal URL" ,
    voting_powers as "Voting Power"

    from external.snapshot.ez_snapshot inner join a on PROPOSAL_ID = PROPOSAL
    QueryRunArchived: QueryRun has been archived