maybeyonaspost_airdrop_stats
Updated 2021-10-19
999
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
›
⌄
-- LETS FIND THE CLAIMS FIRST
with airdrop_claims as(
select
block_timestamp,
claimer,
amount,
-- contract_address,
case contract_address
when 'terra1atch4d5t25csx7ranccl48udq94k57js6yh0vk' then 'loop' -- i guess'
end as airdrop_name,
case contract_address
when 'terra1atch4d5t25csx7ranccl48udq94k57js6yh0vk' then 'terra1nef5jf6c7js9x6gkntlehgywvjlpytm7pcgkn4' -- loop
end as token_contract
from terra.airdrop_claims
),
-- CAUSE USERS MAKE MULTIPLE CLAIMS IN A DAY, WE WILL GROUP BY DATE TO REDUCE COMPLEXITY
claim_txs as(
select
date(block_timestamp) as date,
claimer,
-- contract_address,
airdrop_name,
token_contract,
count(amount) as claims,
sum(amount) as amt_claimed
from airdrop_claims
group by 1,2,3,4
),
-- ALL BUY TRANSACTIONS OF AIRDROP TOKEN
buy as (
select
block_timestamp,
event_attributes:to::string as user,
event_attributes:ask_asset as token_contract,
case event_attributes:ask_asset
when 'terra1nef5jf6c7js9x6gkntlehgywvjlpytm7pcgkn4' then 'loop'
Run a query to Download Data