Lordking789...
Updated 2023-05-02Copy 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
29
›
⌄
with
stake as (
select VALIDATOR_ADDRESS,
sum (amount) as fkow ,
count (distinct tx_id) as flow_TRXS,
count (distinct DELEGATOR_ADDRESS) as fow_Users
from terra.core.ez_staking
where tx_succeeded = 'TRUE'
and action in ('Delegate')
group by 1),
unstake as (
select VALIDATOR_ADDRESS,
sum (amount) as Unfkow ,
count (distinct tx_id) as unflow_TRXS,
count (distinct DELEGATOR_ADDRESS) as unfow_Users
from terra.core.ez_staking
where tx_succeeded = 'TRUE'
and action in ('Undelegate')
group by 1)
select
a.VALIDATOR_ADDRESS node_id,
fkow - Unfkow as Net_Staked ,
flow_TRXS - unflow_TRXS as TRXS ,
fow_Users - unfow_Users as Users
from stake a join unstake b on a.VALIDATOR_ADDRESS = b.VALIDATOR_ADDRESS
order by 2 DESC
limit 10
Run a query to Download Data