sarathUser segmentation_analy1.7
Updated 2023-01-02
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
›
⌄
-- Part1
-------------------------------------------------------
with tab1 as (
select
tx_from,
min(block_timestamp) as First_Transaction
from osmosis.core.fact_transactions
group by 1
)
, tab2 as (
select
trader as user1,
min(block_timestamp) as First_Transaction
from osmosis.core.fact_swaps
group by 1 )
, tab3 as (
select
tx_from as user_address,
tab1.First_Transaction as First_Transaction_Date
from tab1 left outer join tab2
on tab1.tx_from = user1
and tab1.First_Transaction = tab2.First_Transaction )
-- Part 2
------------------------------------------------------
, tab4 as (
select
tx_from,
block_timestamp
from osmosis.core.fact_transactions left outer join tab3
on tx_from = user_address
where block_timestamp not like First_Transaction_Date
)
Run a query to Download Data