sarathUser segmentation_analy1.7
    Updated 2023-01-02

    -- 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