marquAXL Launch - LP Token Holders
    Updated 2022-12-06
    with

    pool_lpt as (

    select

    liquidity_provider_address,
    action,
    case
    when action = 'lp_tokens_minted' then 'Deposit'
    else 'Withdraw'
    end as label_action,
    case
    when label_action = 'Deposit' then amount / pow(10,18)
    else amount / pow(10,18) * (-1)
    end as amount,
    tx_id

    from osmosis.core.fact_liquidity_provider_actions
    where pool_id = 812
    and action in ('lp_tokens_minted','lp_tokens_burned')
    and block_timestamp >= '2022-09-27 16:31:00'
    and tx_status = 'SUCCEEDED'
    ),

    aggregated as (

    select

    liquidity_provider_address,
    sum(amount) as lp_tokens,
    rank() over (order by lp_tokens desc) as rank_lp

    from pool_lpt
    group by 1
    )