0xHaM-dCommunity Pool Spend Proposals Overview
Updated 2023-02-16Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
WITH proposals_detail as (
select
block_timestamp,
attributes:transfer:amount/1e6 as amt,
attributes:transfer:currency as currency,
attributes:transfer:recipient as recipient,
attributes:transfer:sender as sender,
message_value:contract as contract
from terra.core.ez_messages
where message_value:msg:execute:proposal_id is not null
and amt > 0
)
, priceTb as (
select
date_trunc('day', recorded_hour) as date,
avg(close) as luna_price
from crosschain.core.fact_hourly_prices
where id = 'terra-luna-2'
group by 1
)
, proposal_vote as (
SELECT
PROPOSAL_ID,
COUNT(DISTINCT tx_id) as vote,
COUNT(DISTINCT VOTER) as voter,
sum(CASE
WHEN VOTE_OPTION_TEXT = 'Yes' THEN 1
ELSE -1 end) as vote_count
from terra.core.fact_governance_votes
where tx_succeeded = 'TRUE'
and proposal_id not in ('3460')
group by 1
-- HAVING vote_count > 0
)
, proposals as (
select
Run a query to Download Data