boomer77provision lpers
    Updated 2021-11-02
    with add_lp as (select date_trunc('day', block_timestamp) as dt, pool_name, count(distinct from_address) as LP_add
    from thorchain.liquidity_actions
    where lp_action = 'add_liquidity'
    group by 1,2),

    remove_lp as (select date_trunc('day', block_timestamp) as dt, pool_name, count(distinct from_address) as LP_count, concat('-', LP_count) as LP_remove
    from thorchain.liquidity_actions
    where lp_action = 'remove_liquidity'
    group by 1,2)

    select a.dt, a.pool_name, a.LP_add, b.LP_remove, (a.LP_add + b.LP_remove) as LP_count_net_change
    from add_lp A
    join remove_lp B on a.dt = b.dt and a.pool_name = b.pool_name
    Run a query to Download Data