piperJupiter Governance - Votes over time
    Updated 2024-12-14
    -- forked from Jupiter Governance - Votes over time @ https://flipsidecrypto.xyz/studio/queries/7a1ef445-0e96-4c5b-b4c4-92d32cb9d5d4

    -- forked from Jupiter Governance - Votes in numbers @ https://flipsidecrypto.xyz/studio/queries/bdf98bd1-670d-44de-b72e-435ba735650d
    -- forked from Jupiter Governance - Votes @ https://flipsidecrypto.xyz/studio/queries/dfed74a9-d2d0-41f3-814b-09bbccc3c1a2
    -- forked from kellen / Jupiter LFG Token Launchpad Results @ https://flipsidecrypto.xyz/kellen/q/vdO1szn5p_tq/jupiter-lfg-token-launchpad-results
    with t0 as (
    select decoded_instruction:args:side::string as side
    , decoded_instruction:args:weight::int * power(10, -6) as weight
    , signers[0]::string as voter
    , value:pubkey::string AS proposal
    , value:name::string AS name
    , block_timestamp
    from solana.core.fact_decoded_instructions i
    , LATERAL FLATTEN(input => decoded_instruction:accounts)
    where block_timestamp >= '2024-03-06'
    and i.program_id in (
    'GovaE4iu227srtG2s3tZzB4RmWBzw8sTwrCLZz7kN7rY'
    )
    and name = 'proposal'
    and proposal = 'CWAwYcLmniqQYnzDh3QGRH6FtymBesJ9dzk1EBvYNBwK'
    and side is not null
    and weight is not null
    and event_type = 'setVote'
    qualify(
    row_number() over (partition by voter order by block_timestamp desc) = 1
    )
    )
    select
    DATE_TRUNC('day', BLOCK_TIMESTAMP) AS "Date",
    round(sum(weight)) as "Votes",
    count(1) as "Voters",
    sum("Votes") over (order by "Date" asc) as "Cumulative Votes",
    sum("Voters") over (order by "Date" asc) as "Cumulative Voters",
    from
    t0
    GROUP BY 1
    Last run: 26 days ago
    Date
    Votes
    Voters
    Cumulative Votes
    Cumulative Voters
    1
    2024-11-25 00:00:00.0001796690975774117966909757741
    2
    2024-11-26 00:00:00.00012787374773882307542844131623
    3
    2024-11-27 00:00:00.0003161555730602339158401162225
    4
    2024-11-28 00:00:00.0001267246715676351830868177901
    5
    2024-11-29 00:00:00.000125455668768364376434186669
    5
    301B
    5s