MadiStake & unstake count
Updated 2023-04-13Copy 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
›
⌄
(SELECT
-- date_trunc ('week',block_timestamp) as date,
case when action = 'Delegate' then 'Stake' end as action,
count (distinct TX_ID) as TX_Count,
sum (amount) as Volume
-- case when action = 'Delegate' then 'Stake' end as action
FROM terra.core.ez_staking
WHERE action = 'Delegate' and block_timestamp >= CURRENT_DATE - 180 and TX_SUCCEEDED = 'TRUE'
group by 1
order by 2
)
UNION ALL
(SELECT
-- date_trunc ('week',block_timestamp) as date,
case when action = 'Undelegate' then 'Unstake' end as action,
count (distinct TX_ID) as TX_Count,
sum (amount) as Volume
FROM terra.core.ez_staking
WHERE action = 'Undelegate' and block_timestamp >= CURRENT_DATE - 180 and TX_SUCCEEDED = 'TRUE'
group by 1
order by 2
)
Run a query to Download Data