FatemeTheLadyOPA7
Updated 2022-10-21
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 a as (select delegator, tx_hash, block_timestamp as t, to_delegate
from optimism.core.fact_delegations
where delegation_type = 'First Time Delegator'),
b as (select origin_from_address as wallet_address, block_timestamp as t
,tx_hash, event_inputs:amount/10e17 as OP_claimed
from optimism.core.fact_event_logs
where --tx_hash = '0x19a37ff805db12a4944332998257eeec2da5aaa20e8bec17bf3f718a94f620d2' and
event_name = 'Claimed' and
contract_address = '0xfedfaf1a10335448b7fa0268f56d2b44dbd357de')
, c as ( select to_delegate, count( distinct wallet_address) as "number of gelegators"
from a right join b on b.wallet_address=a.delegator
where to_delegate is not null
group by 1
order by 2 desc
--limit 5
)
select
case when to_delegate = '0x5e349eca2dc61abcd9dd99ce94d04136151a09ee' then 'lindajxie.eth'
when to_delegate = '0xb1ea5a3e5ea7fa1834d48058ecda26d8c59e8251' then 'Quixotic (Optimism NFT Marketplace)'
when to_delegate = '0xa6e8772af29b29b9202a073f8e36f447689beef6' then 'gfxlabs.eth'
when to_delegate = '0x429f9ada43e9f345cbb85ec88681bb70df808892' then 'polynya.eth'
when to_delegate = '0x48a63097e1ac123b1f5a8bbffafa4afa8192fab0' then 'ceresstation.eth'
else 'Others'
end as "label"
,sum("number of gelegators" ) as "number of gelegators"
from c group by 1
Run a query to Download Data