freemartianLVN remove liquidity
    Updated 2023-12-29
    WITH remove_liquidity AS (
    SELECT
    tx_id,
    msg:attributes[3]:value AS pool_id,
    msg:attributes[2]:value AS sender
    FROM osmosis.core.fact_msgs
    WHERE tx_id in(
    SELECT tx_id
    FROM osmosis.core.fact_tx_body_msgs
    WHERE msg_type = '/osmosis.concentratedliquidity.v1beta1.MsgWithdrawPosition'
    AND block_timestamp::date >= current_date - 10
    )
    AND msg_type = 'withdraw_position'
    AND pool_id IN ('1325','1337')
    )




    SELECT
    block_timestamp,
    msgs.tx_id,
    pool_id,
    sender,

    split_part(msg:attributes[1]:value,',',1) AS msg1,

    (CASE
    WHEN msg1 LIKE '%/ulvn%' THEN RIGHT(msg1,76)
    WHEN msg1 LIKE '%uosmo%' THEN RIGHT(msg1,5)
    WHEN msg1 LIKE '%498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4%' THEN RIGHT(msg1,68)
    ELSE msg1
    END
    ) AS token1_denom,
    (CASE
    QueryRunArchived: QueryRun has been archived