0xaimanLiquidity Metrics in Terra Pools (USD)
    Updated 2022-06-14


    select pool_name, min(CURRENT_LIQUIDITY_USD) as min_liquidity_usd ,avg(CURRENT_LIQUIDITY_USD) as avg_liquidity_usd,max(CURRENT_LIQUIDITY_USD) as max_liquidity_usd
    from (with a as (select from_address,pool_name, sum(asset_amount_usd) as adl -- date_trunc('week',block_timestamp) as dt, pool_name, lp_action, sum(rune_amount_usd+asset_amount_usd) as volume_capital
    from thorchain.liquidity_actions

    where lp_action='add_liquidity' and from_address is not null and pool_name like 'TERRA.%'
    -- group by 1,2,3 order by 1

    group by 1,2 order by 3 desc),

    b as (select from_address,pool_name, sum(asset_amount_usd) as rml -- date_trunc('week',block_timestamp) as dt, pool_name, lp_action, sum(rune_amount_usd+asset_amount_usd) as volume_capital
    from thorchain.liquidity_actions

    where lp_action='remove_liquidity' and from_address is not null and pool_name like 'TERRA.%'
    -- group by 1,2,3 order by 1

    group by 1,2 order by 3 desc)

    select a.from_address, a.pool_name, adl-rml as current_liquidity_usd
    from a inner join b on a.from_address=b.from_address)
    where CURRENT_LIQUIDITY_USD>0.01

    group by 1
    Run a query to Download Data