Updated 2023-03-27
    with t1 as (select
    date_trunc('day',block_timestamp) as dt1,
    count(distinct from_address) as total_user
    from thorchain.liquidity_actions
    where LP_ACTION='remove_liquidity'
    and block_timestamp>='2022-01-01'
    group by 1),

    t2 as(select
    date_trunc('day',block_timestamp) as dt2,
    count(distinct from_address) as user_withinsurance
    from thorchain.liquidity_actions
    where LP_ACTION='remove_liquidity'
    and il_protection>0
    and block_timestamp>='2022-01-01'
    group by 1)

    select
    t1.dt1 as dt,
    total_user,
    user_withinsurance,
    user_withinsurance/total_user*100 as percent_with_insurance
    from t1
    inner join t2 on t1.dt1=t2.dt2
    Run a query to Download Data