adriaparcerisasSushi noobs II
Updated 2022-06-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
›
⌄
WITH
new_users as (
SELECT
distinct origin_from_address as user,
min(block_timestamp) as first_acquisition
from ethereum.core.ez_dex_swaps
where symbol_out='SUSHI' AND amount_out>0
group by 1
),
final_data as (
SELECT
distinct origin_from_address as user,
min(block_timestamp) as first_tx_after_sushi
from ethereum.core.fact_event_logs x
join new_users y on x.origin_from_address=y.user
and x.block_timestamp>y.first_acquisition
group by 1
)
SELECT
--origin_function_signature
distinct event_name,
count(distinct tx_hash) as counts
from ethereum.core.fact_event_logs x
join final_data y
on x.origin_from_address=y.user
and x.block_timestamp=y.first_tx_after_sushi
and event_name is not null
group by 1
order by 2 desc
Run a query to Download Data