0xaimanUntitled Query
    Updated 2022-01-25

    with pnv as (with pdata as (select tx_id
    from terra.msg_events, table(flatten(input=>EVENT_ATTRIBUTES))ea
    where --tx_id='52BC229FE16E3838C1145000DAA209A3D5AA62993E26ED75C319840DC338187C' and
    event_type='wasm' and key='0_action' and value='provide_liquidity'
    ),

    lp as(select tx_id,value/1000000 as lpp
    from terra.msg_events, table(flatten(input=>EVENT_ATTRIBUTES))ea
    where --tx_id='52BC229FE16E3838C1145000DAA209A3D5AA62993E26ED75C319840DC338187C' and
    event_type='wasm' and key='1_amount'
    )

    select pdata.tx_id, lpp
    from lp
    inner join pdata on pdata.tx_id=lp.tx_id
    ),

    lca as (

    select tx_id, ea.value as lca --loop contract address
    from terra.msg_events, table(flatten(input=>EVENT_ATTRIBUTES))ea
    where --tx_id='C1001D96EE7E1C7CA5C898DA72ED2686ACFE6B29A3786765D36B7A2B2E461026' and
    event_type='wasm' and key='0_contract_address'
    and
    value='terra19rvwt8gjqjpgwhg6h0hpvrrrxe3ljll8savt6t'
    )

    select lca.tx_id,lca, lpp
    from pnv
    inner join lca on lca.tx_id=pnv.tx_id
    limit 100
    Run a query to Download Data