Ali3NTop 10 Voters (& Their Type) With Most Number of Votes on Recent 5 Proposals
    Updated 2023-01-21
    with terravalidators as (
    select REPLACE(ATTRIBUTE_VALUE, 'valoper', '') as validator_address1,
    left(validator_address1, 38) as Account_address
    from terra.core.fact_msg_attributes
    where ATTRIBUTE_KEY= 'source_validator'
    and tx_succeeded = 'TRUE'),

    maintable as (
    select 'Proposal #' || proposal_id as proposalid,
    voter,
    count (Distinct tx_id) as Votes_Count,
    count (distinct voter) as Voters_Count
    from terra.core.fact_governance_votes t1
    where proposal_id in ('3796','3795','3794','3665','3619')
    and tx_succeeded = 'TRUE'
    group by 1,2)

    select case when voter = 'terra1t3zvwaz7v3epg3f33waxajv4nj95mt8ma2g9wm' then 'TTLG Money'
    when voter = 'terra13n2fsvfvj28eqvkjejhqlxf3pch3muxkxnpqgt' then 'StakeBIN'
    when voter = 'terra1tm0xkark2ufecmdhgaaw7gqsycyt4qag6wg6kf' then 'Synergy Nodes'
    when voter = 'terra1pgyelqv0hwjavgf6vhdm4e4pt766wfxxcdshlv' then 'High Stakes 🇨🇭'
    when voter = 'terra1ettjrqla8cpmx0wvdurjynn7776gurx5ywfufx' then 'RuneTerra'
    when voter = 'terra1jveyrzquwrt0txanmhg7jdhf2q4ry28k2kuuqx' then 'stakingcabin'
    when voter = 'terra188e99yz54744uhr8xjfxmmplhnuw75xeamclej' then 'Smart Stake'
    when voter = 'terra1hr7svdp2rga9vf3ry95sx7g5wyspgwmg94qac8' then 'PFC - Panama Flower Company'
    when voter = 'terra1chzrxuuajgp4huaanpwuz63xtc2wyq3mfddty6' then 'Goliath'
    when voter = 'terra1puzp2yjqps43x7nse33svljc550xjz35jfygpe' then 'Pro-Nodes75'
    when voter = 'terra1qlgyrmaadru03rd9j0w9nr5p2quhthlrhn7trn' then 'Interdimensional Cable'
    when voter = 'terra1fmdwg64xgd8jylhxkuq5kd5xc80f3mdqyarssk' then 'Craig '
    when voter = 'terra1rr2g4z2ch4cqwl8s70yj94a5l2vakg0v34lxzy' then 'polkachu.com'
    when voter = 'terra1ygmjw8f34uadvspjfeu7vhptqmp8j925azgpqa' then 'Moon Dog'
    when voter = 'terra17kh8ngu3s74epwympaxrp4ukahm5rvtf5d56tw' then 'danku_zone w/ DAIC '
    when voter = 'terra1ge3vqn6cjkk2xkfwpg5ussjwxvahs2f6aytr5j' then 'coinhall.org'
    when voter = 'terra14q4vvp2vtmfcaejx4qy8nw9autudx0zjt7r76x' then 'Block-Foundry '
    when voter = 'terra14rftkw37eltf74degzajq4s5phg23vjlu2mcdr' then 'Setten '
    when voter = 'terra1j4cc2p4f4t4m3z37gumr6cr64vm605aa4ph956' then 'Moon Platoon'
    Run a query to Download Data