Abbas_ra21Top 20 Lp Users [by Deposited Amount]
    Updated 2024-05-08
    -- forked from LP users osmo @ https://flipsidecrypto.xyz/edit/queries/9c508a37-5594-4e14-8192-950126a0eb60

    -- forked from LP users @ https://flipsidecrypto.xyz/edit/queries/8c8f2937-c6d3-4420-bd7f-4c5f58ac9b98

    -- forked from Pools Daily flow:SEI/USD @ https://flipsidecrypto.xyz/edit/queries/dc209cf2-ddbb-406f-834d-62afbb860b35

    with main AS (
    select
    m.BLOCK_TIMESTAMP,
    m.TX_ID,
    case
    when MSG_TYPE = 'wasm-liquidity-deposit' then 'Deposit'
    else 'Withdraw'
    end AS Action,
    CASE
    when ATTRIBUTE_VALUE='osmo1nzddhaf086r0rv0gmrepn3ryxsu9qqrh7zmvcexqtfmxqgj0hhps4hruzu' THEN 'BTC'
    when ATTRIBUTE_VALUE='osmo1hd7r733w49wrqnxx3daz4gy7kvdhgwsjwn28wj7msjfk4tde89aqjqhu8x' THEN 'ATOM'
    when ATTRIBUTE_VALUE='osmo127aqy4697zqn27z0vqr3x2n8lraf27t7udvl6ef5hcwmwhjadegq9vytdj' THEN 'OSMO'
    when ATTRIBUTE_VALUE='osmo19c7hdlfvu7cddr0smfz9luaj8375qhfr3s0gtsk087laqfzxlu3qsnk47e' THEN 'axlETH'
    when ATTRIBUTE_VALUE='osmo186nlf2fwfglq8u4nj3f7mwg8uc79j22qhaau4scdyur47e0fatas34vcn9' THEN 'SEI'
    end AS Pool,
    User,
    avg(Amount) AS AMount,
    avg(Amount_USD) AS Amount_USD
    from
    osmosis.core.fact_msg_attributes m
    inner join (
    select
    TX_ID,
    ATTRIBUTE_VALUE AS Amount_USD
    from
    osmosis.core.fact_msg_attributes
    where
    MSG_TYPE in (
    'wasm-liquidity-deposit',
    'wasm-liquidity-withdraw'
    QueryRunArchived: QueryRun has been archived