freemartian2024-01-02 07:00 PM
    Updated 2024-01-03
    -- with tbl AS (
    -- SELECT *
    -- FROM osmosis.core.fact_msg_attributes
    -- WHERE msg_type IN ('withdraw_position','create_position')
    -- AND attribute_key = 'pool_id'
    -- AND attribute_value IN ('1325','1337')
    -- AND block_timestamp::date = current_date
    -- ORDER BY tx_id ASC, attribute_index ASC
    -- )

    -- SELECT
    -- block_timestamp, tx_id, msg_type,attribute_index, attribute_key, attribute_value
    -- FROM osmosis.core.fact_msg_attributes
    -- WHERE tx_id IN ('88043B470221D52FAB8FF7984BD5052FF98AA82FF37E1758D641C0FE470916D4')
    -- -- WHERE tx_id IN (SELECT tx_id FROM tbl)
    -- AND msg_type IN ('withdraw_position','create_position','add_to_position')
    -- ORDER BY tx_id ASC, attribute_index ASC




    with add_liquidity AS (
    SELECT
    block_timestamp,
    tx_id,
    msg:sender AS sender,
    (CASE
    WHEN msg:tokens_provided[0]:denom = 'factory/osmo1mlng7pz4pnyxtpq0akfwall37czyk9lukaucsrn30ameplhhshtqdvfm5c/ulvn' THEN 'LVN'
    WHEN msg:tokens_provided[0]:denom = 'ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4' THEN 'USDC'
    WHEN msg:tokens_provided[0]:denom = 'uosmo' THEN 'OSMO'
    END) AS first_token_symbol,
    msg:tokens_provided[0]:amount AS first_token_raw_amount,
    msg:tokens_provided[0]:amount/pow(10,6) AS first_token_amount,
    (CASE
    WHEN msg:tokens_provided[1]:denom = 'factory/osmo1mlng7pz4pnyxtpq0akfwall37czyk9lukaucsrn30ameplhhshtqdvfm5c/ulvn' THEN 'LVN'
    QueryRunArchived: QueryRun has been archived