lagandispenserdistribution open LP position
    Updated 2022-06-28
    with Lpers as (
    select
    from_address as wallet,
    sum (iff(lp_action = 'add_liquidity',rune_amount , -rune_amount ) ) as sum_rune_amount
    from thorchain.liquidity_actions
    where lp_action in ('add_liquidity' ,'remove_liquidity')
    and rune_amount > 0
    and rune_amount is not null
    and tx_id is not NULL
    group by 1
    )
    select case when sum_rune_amount BETWEEN 0 and 1 then '0-1'
    when sum_rune_amount BETWEEN 1 and 10 then '1-10'
    when sum_rune_amount BETWEEN 10 and 100 then '10-100'
    when sum_rune_amount BETWEEN 100 and 500 then '100-500'
    when sum_rune_amount BETWEEN 500 and 1000 then '500-1K'
    when sum_rune_amount BETWEEN 1000 and 10000 then '1K-10K'
    when sum_rune_amount BETWEEN 10000 and 100000 then '10K-100K'
    else 'greater than 100K'
    end as range ,
    count (wallet) as num_wallets
    from Lpers
    group by 1
    Run a query to Download Data