boomer77first lp sushiswap %
    Updated 2021-11-24
    with raw as (select from_address,
    date(block_timestamp) as dt,
    ROW_NUMBER() OVER (PARTITION BY from_address ORDER BY block_timestamp) as num
    from ethereum.transactions
    where to_label = 'sushiswap' and function_name in ('addLiquidity', 'addLiquidityETH') and success = 'TRUE'),

    total as (select date_trunc('day', block_timestamp) as dt, count(distinct tx_id) as LP_tx_count, count(distinct from_address) as LPers_count
    from ethereum.transactions
    where to_label = 'sushiswap' and function_name in ('addLiquidityETH','addLiquidity') and block_timestamp >= CURRENT_DATE - 89 and success = 'TRUE'
    group by 1
    order by 1 desc),

    firstlp as (select dt, count (distinct from_address) as first_lp
    from raw
    where num = 1 and dt >= CURRENT_DATE - 89
    group by 1)

    select a.dt, a.first_lp, b.LPers_count, (a.first_lp/b.LPers_count)*100 as "% of First LP"
    from firstlp a
    join total b on a.dt = b.dt
    Run a query to Download Data