fateeUser Interaction Rank In Hot Contracts (>100 $ETH Paid Fee)
Updated 2023-12-04
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
top_contracts as (
select CONTRACT_ADDRESS, ifnull(CONTRACT_NAME,ADDRESS_NAME) as CONTRACT_NAME, TOTAL_FEE
from
(select
value[0]::string as CONTRACT_ADDRESS,
value[1]::string as SYMBOL,
value[2]::string as CONTRACT_NAME,
value[3]::string as TOTAL_FEE
from (select livequery.live.udf_api('https://flipsidecrypto.xyz/api/queries/4d9e7c78-d47c-46b4-b201-08e03c23e28c/latest-run')
as response), lateral FLATTEN (input => response:data:data))
left join ethereum.core.dim_labels
on CONTRACT_ADDRESS=ADDRESS
),
top_contracts_users as
(select CONTRACT_ADDRESS, CONTRACT_NAME, TOTAL_FEE,
FROM_ADDRESS as user,
min(BLOCK_TIMESTAMP) as min_date,
rank() over (partition by CONTRACT_ADDRESS order by min_date asc) as rank
from ethereum.core.fact_transactions a
join top_contracts b
on CONTRACT_ADDRESS=TO_ADDRESS
group by 1,2,3,4),
eth_og_users as
(select user, count(CONTRACT_ADDRESS) as contracts
from top_contracts_users
where rank<=1000
group by 1)
select
case when rank<=1000 then '✅' else '❌' end as "Early",
CONTRACT_ADDRESS as "Contract",
CONTRACT_NAME as "Contract Name", rank as "User Early Rank", min_date as "First Interaction Date"
from top_contracts_users