Abbas_ra21cosmos #1
Updated 2022-12-14
99
1
2
3
4
5
6
7
8
9
10
11
›
⌄
SELECT
date_trunc("month",BLOCK_TIMESTAMP) AS month,
sum(case when MSG_TYPE='redelegate' and ATTRIBUTE_KEY='amount' then
split(attribute_value,'uatom')[0]::numeric / pow(10,6) end) AS "Redelegate Amount",
sum(case when MSG_TYPE='unbond' and ATTRIBUTE_KEY='amount' then
split(attribute_value,'uatom')[0]::numeric / pow(10,6) end) AS "Undelegate Amount",
sum(case when MSG_TYPE='delegate' and ATTRIBUTE_KEY='amount' then
split(attribute_value,'uatom')[0]::numeric / pow(10,6) end) AS "delegate Amount"
FROM
cosmos.core.fact_msg_attributes
group by 1
Run a query to Download Data