theericstoneuser profiles
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
›
⌄
-- let's use tags and labels to understand
-- who is engaging with particular contract
-- first let's find addresses that have
-- used a contract of interest
-- join with labels to find any known protocols
-- or contracts that are directly engaging
with
users as (
select
origin_from_address as address,
labs.address_name,
labs.label,
sum(amount_out) as total_bought,
count(distinct (tx_hash)) as n_buys
from
ethereum.core.ez_dex_swaps swaps
left join ethereum.core.dim_labels labs on swaps.origin_from_address = labs.address
where
token_out = lower('{{tokenaddress}}')
and block_timestamp > current_date - {{daysago}}
group by
1,
2,
3
having
total_bought > {{minbought}}
),
-- now we will pick a few tags that we find relevant
-- for our present analysis
-- you can find other tags in our docs
-- here: https://docs.flipsidecrypto.com/our-data/featured-tags-and-sql-examples
tagrank as (
select distinct
address,
first_value(tag_name) over (
Run a query to Download Data