connorhAirdrop Flows
Updated 2021-07-22
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 recursive eth_recurse
-- Column names for the "view"/CTE
(airdrop_recipient, to_address, degree_out,total_claimed,first_claim_time)
as
-- Common Table Expression
(
-- Anchor is airdrop recipients and the amounts they received
select
from_address as airdrop_recipient,
to_address,
1 AS degree_out,
sum(amount) as total_claimed,
min((((tctoflbrsttclaim_time
from ethereum.udm_events where from_address = LOWER('0x090d4613473dee047c3f2706764f49e0821d256e')
and block_timestamp > '2020-09-01' and block_timestamp < '2020-11-01'
and symbol = 'UNI'
and origin_function_name = 'claim'
group by 1,2,3
union all
-- Recursive bit
SELECT
b.airdrop_recipient AS airdrop_recipient,
a.to_address,
a.degree_out + 1 AS degree_out,
a.total_claimed,
b.first_claim_time
FROM eth_recurse b
LEFT JOIN (
select
from_address as airdrop_recipient,
to_address,
1 AS degree_out,
sum(amount) as total_claimed,
min(block_timestamp) as first_claim_time
Run a query to Download Data