Abbas_ra21Flash Bounty - 2. Governing the Cosmos #6
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
›
⌄
with Tb AS (Select
'Terra' AS Chain,
A.BLOCK_TIMESTAMP AS "Submit Date",
B.BLOCK_TIMESTAMP AS "Vote Date",
timediff('HOUR',"Submit Date","Vote Date") AS "Votimg Time"
from terra.core.fact_governance_submit_proposal A inner join terra.core.fact_governance_votes B on A.PROPOSAL_ID=B.PROPOSAL_ID
union ALL
Select
'Cosmos' AS Chain,
A.BLOCK_TIMESTAMP AS "Submit Date",
B.BLOCK_TIMESTAMP AS "Vote Date",
timediff('HOUR',"Submit Date","Vote Date") AS "Votimg Time"
from cosmos.core.fact_governance_submit_proposal A inner join cosmos.core.fact_governance_votes B on A.PROPOSAL_ID=B.PROPOSAL_ID
UNION ALL
Select
'Osmosis' AS Chain,
A.BLOCK_TIMESTAMP AS "Submit Date",
B.BLOCK_TIMESTAMP AS "Vote Date",
timediff('HOUR',"Submit Date","Vote Date") AS "Votimg Time"
from osmosis.core.fact_governance_submit_proposal A inner join osmosis.core.fact_governance_votes B on A.PROPOSAL_ID=B.PROPOSAL_ID )
select
chain,
case when "Votimg Time" <1 then 'less than 1-HOUR'
when "Votimg Time">=1 and "Votimg Time"<=4 then '1-4 HOUR'
when "Votimg Time"> 4 and "Votimg Time"<=8 then '4-8 HOUR'
when "Votimg Time"> 8 and "Votimg Time"<=12 then '8-12 HOUR'
when "Votimg Time"> 12 and "Votimg Time"<=24 then '12-24 HOUR'
when "Votimg Time" > 24 then 'more than 1-day'
end AS Time,
count(*) AS "Votes number"
from tb group by 1,2
Run a query to Download Data