scottincryptoDelegator Tx Count Exclude Arbs
Updated 2021-07-25
999
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
32
33
34
35
36
›
⌄
with delegate_action_sum as (
SELECT
delegator_address,
action,
case
when action = 'delegate' then sum(event_amount)
when action = 'undelegate' then -sum(event_amount)
end as net_delegated_amount
from terra.staking
where action in ('delegate','undelegate')
group by 1,2
),
top_delegators as (
select
delegator_address,
sum(net_delegated_amount) as delegated_amount
from delegate_action_sum
--where sum(net_delegated_amount) is not null
group by 1
order by 2 DESC
limit 100
),
top_nondelegators as (
select
address,
address_label,
sum(balance_usd) as total_balance
from terra.daily_balances
where date = '2021-07-24'--(select max(date) from terra.daily_balances)
and address_label is null
and address not in (select delegator_address from delegate_action_sum)
group by 1,2
order by 3 DESC
limit 100
Run a query to Download Data