theericstoneBasic Airdrop Tracker Round 1
Updated 2022-10-06Copy 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 drops as (
select event_inputs:recipient::string as address,
min(block_timestamp) as min_time,
sum(event_inputs:amount::numeric / pow(10,18)) as amount_dropped
from optimism.core.fact_event_logs
where block_timestamp > '2022-05-30'
and origin_function_signature = '0x2e7ba6ef' -- claim
and contract_address = lower('0xFeDFAF1A10335448b7FA0268F56D2B44DBD357de') -- distr contract
group by address
),dumps as (
SELECT
from_address as address,
sum(raw_amount / pow(10,18)) as amount_dumped
from optimism.core.fact_token_transfers xf
join drops d on xf.from_address = d.address
where contract_address = '0x4200000000000000000000000000000000000042' -- OP
and block_timestamp >= min_time
and tx_hash in (
select distinct tx_hash from
optimism.core.fact_event_logs
where block_timestamp > '2022-05-29'
and lower(event_name) like '%swap%'
)
group by 1
),buys as (
SELECT
to_address as address,
sum(raw_amount / pow(10,18)) as amount_bought
from optimism.core.fact_token_transfers xf
join drops d on xf.to_address = d.address
where contract_address = '0x4200000000000000000000000000000000000042' -- OP
and block_timestamp >= min_time
and tx_hash in (
select distinct tx_hash from
optimism.core.fact_event_logs
where block_timestamp > '2022-05-29'
Run a query to Download Data