Abolfazl_771025Volume of Stake and Un-stake at last 6 month
Updated 2022-07-19Copy 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
›
⌄
WITH deligate as (
SELECT
date_trunc('day',BLOCK_TIMESTAMP) as "date1",
SUM(amount / pow(10,6)) AS "DELIGATOR VOLUME"
FROM osmosis.core.fact_staking
WHERE ACTION = 'delegate'
AND tx_status = 'SUCCEEDED'
AND "date1" BETWEEN '2022-01-18' AND '2022-07-18'
group by 1
order by 1
), undeligate as (
SELECT
date_trunc('day',BLOCK_TIMESTAMP) as "date2",
SUM(amount / pow(10,6)) AS "UNDELIGATOR VOLUME"
FROM osmosis.core.fact_staking
WHERE ACTION = 'undelegate'
AND tx_status = 'SUCCEEDED'
AND "date2" BETWEEN '2022-01-18' AND '2022-07-18'
group by 1
order by 1
)
SELECT
"date1",
"DELIGATOR VOLUME",
"UNDELIGATOR VOLUME"
FROM deligate FULL JOIN undeligate on "date1"="date2"
GROUP by 1,2,3
ORDER by 1
Run a query to Download Data