2844Governance Grind 4-Validators Participation in Governance Votes
    Updated 2023-01-25
    with validators 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')

    select '3795' as "PROPOSAL ID",
    'Validators' as Status,
    count (distinct tx_id) as Votes_Count,
    count (distinct Account_address) as Voters_count
    from terra.core.fact_governance_votes t1 join validators t2 on left(t1.voter, 38) = t2.Account_address
    where tx_succeeded = 'TRUE'
    and PROPOSAL_ID in ('3795')

    union ALL
    select '3796' as "PROPOSAL ID",
    'Validators' as Status,
    count (distinct tx_id) as Votes_Count,
    count (distinct Account_address) as Voters_count
    from terra.core.fact_governance_votes t1 join validators t2 on left(t1.voter, 38) = t2.Account_address
    where tx_succeeded = 'TRUE'
    and PROPOSAL_ID in ('3796')

    union ALL
    select '3794' as "PROPOSAL ID",
    'Validators' as Status,
    count (distinct tx_id) as Votes_Count,
    count (distinct Account_address) as Voters_count
    from terra.core.fact_governance_votes t1 join validators t2 on left(t1.voter, 38) = t2.Account_address
    where tx_succeeded = 'TRUE'
    and PROPOSAL_ID in ('3794')


    union ALL
    select '3665' as "PROPOSAL ID",
    Run a query to Download Data