zakkisyedThorchain remove liquidity over time
    Updated 2021-12-18
    WITH add_liquidity
    as
    (SELECT block_timestamp as add_timestamp, from_address
    FROM thorchain.liquidity_actions
    WHERE
    lp_action = 'add_liquidity'),
    remove_liquidity as
    (SELECT block_timestamp as remove_timestamp, from_address FROM thorchain.liquidity_actions
    WHERE
    lp_action = 'remove_liquidity')

    SELECT
    count(DISTINCT a.from_address) as add_liquidity_count,
    count(DISTINCT r.from_address) as remove_liquidity_count,
    date_trunc('day', r.remove_timestamp)

    FROM
    add_liquidity a,
    remove_liquidity r
    group by 3
    order by 3 desc
    Run a query to Download Data