theericstoneComptroller Flows
Updated 2021-10-23
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
30
31
32
33
34
35
36
›
⌄
with all_depositors as (
select DISTINCT
supplier as address,
'user' as dep_lab
from compound.deposits
where block_timestamp > '2020-08-01'
),
top_claimers as (
with claims as (
SELECT tx_id from
ethereum.transactions
where function_name = 'claimComp'
and to_address = '0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b' -- comptroller
and block_id > 13320900
and success = TRUE
),
all_claims as (
SELECT
to_address,
sum(amount) as amount_claimed
from ethereum.udm_events ude
join claims on ude.tx_id = claims.tx_id
where contract_address = '0xc00e94cb662c3520282e6f5717214004a7f26888' -- COMP
and from_address = '0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b' -- comptroller
and amount > 0
and block_id > 13320900
group by 1
order by 2 desc
)
SELECT to_address as address,
'top_claimer' as c_lab
from all_claims where amount_claimed > 250
)
Run a query to Download Data