rajsTerra Proposals
Updated 2023-01-12
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 terra_deposits as
(
SELECT
-- 'Terra' as blockchain,
proposal_id,
sum(amount) as deposit_amount
-- min(min_date) as min_deposit_date,
-- max(max_date) as max_deposit_date,
-- sum(no_of_txs) as no_of_deposit_txs
FROM
(
SELECT
-- *
attributes:proposal_deposit:proposal_id::int as proposal_id,
sum(attributes:proposal_deposit:amount) / pow(10,6) as amount
-- min(block_timestamp) as min_date,
-- max(block_timestamp) as max_date,
-- count(*) as no_of_txs
from terra.core.ez_messages
where message_type = '/cosmos.gov.v1beta1.MsgSubmitProposal'
group by 1
union all
SELECT
-- *
message_value:proposal_id::int as proposal_id,
sum(message_value:amount[0]:amount) / pow(10,6) as amount
-- min(block_timestamp) as min_date,
-- max(block_timestamp) as max_date,
-- count(*) as no_of_txs
-- *
from terra.core.ez_messages
where message_type = '/cosmos.gov.v1beta1.MsgDeposit'
group by 1
)
Run a query to Download Data