0xHaM-dToken Delegation Overview
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
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with optimism_airdrop_claim_transactions as (
select
block_timestamp,
event_inputs:recipient as address,
event_inputs:amount as op_amount_claimed
from optimism.core.fact_event_logs
where origin_to_address = '0xfedfaf1a10335448b7fa0268f56d2b44dbd357de'
and contract_address = '0xfedfaf1a10335448b7fa0268f56d2b44dbd357de'
and event_name = 'Claimed'
and tx_status = 'SUCCESS'
and origin_function_signature = '0x2e7ba6ef'
and block_timestamp::date <= current_date - 1
),
all_claim_overview as (
select
count(distinct address) as number_of_user,
sum(op_amount_claimed/1e18) as total_amount
from optimism_airdrop_claim_transactions
),
optimism_airdrop_delegations as (
select
delegations.tx_hash,
delegations.block_timestamp,
delegations.delegator,
delegations.to_delegate,
claim.op_amount_claimed as delegate_amount
from optimism.core.fact_delegations delegations
join optimism_airdrop_claim_transactions claim
on delegations.delegator = claim.address
and delegations.block_timestamp >= claim.block_timestamp
where delegations.delegation_type = 'First Time Delegator'
and status = 'SUCCESS'
)
select
count(distinct delegator) as "Number of Delegator",
Run a query to Download Data