shadilIL Insurance - over time
    Updated 2022-04-13
    with all_remove as (
    SELECT
    'all_users_remove' as type,
    block_timestamp::date as date,
    count(DISTINCT from_address) as count_users
    from thorchain.liquidity_actions
    where lp_action = 'remove_liquidity'
    GROUP BY date
    ),
    receiving_il as (
    SELECT
    'received_il' as type,
    block_timestamp::date as date,
    count(DISTINCT from_address) as count_users
    from thorchain.liquidity_actions
    where lp_action = 'remove_liquidity'
    and il_protection > 0
    and il_protection is not NULL
    GROUP BY date
    )

    SELECT * FROM all_remove
    UNION
    SELECT * FROM receiving_il
    Run a query to Download Data