somethingelseLiquidated Mirror collateral filtered by collateral
    Updated 2022-01-04
    select
    m.block_id,
    m.event_attributes:"owner"::string as borrower,
    m.tx_id,
    m.event_attributes:liquidated_amount[0]:amount/ pow(10, 6) as liquidated_mAsset_amount,
    m.event_attributes:return_collateral_amount[0]:amount/ pow(10, 6) as liquidated_collateral_amount,
    m.event_attributes:return_collateral_amount[0]:denom::string as liquidated_collateral,
    m.event_attributes:protocol_fee[0]:amount/ pow(10, 6) as protocol_fee,
    m.event_attributes:"position_idx"::string as position_idx,
    'Liquidated' as position_type
    from terra.msg_events m
    where m.event_type = 'from_contract'
    and m.event_attributes:liquidated_amount[0]:denom::string = 'terra1aa00lpfexyycedfg5k2p60l9djcmw0ue5l8fhc'
    and m.event_attributes:"position_idx"::string is NOT NULL
    UNION
    select
    m.block_id,
    m.event_attributes:"owner"::string as borrower,
    m.tx_id,
    m.event_attributes:liquidated_amount[0]:amount/ pow(10, 6) as liquidated_mAsset_amount,
    m.event_attributes:return_collateral_amount[0]:amount/ pow(10, 6) as liquidated_collateral_amount,
    m.event_attributes:return_collateral_amount[0]:denom::string as liquidated_collateral,
    m.event_attributes:protocol_fee[0]:amount/ pow(10, 6) as protocol_fee,
    m.event_attributes:"0_position_idx"::string as position_idx,
    'Liquidated' as position_type
    from terra.msg_events m
    where m.event_type = 'from_contract'
    and m.event_attributes:liquidated_amount[0]:denom::string = 'terra1aa00lpfexyycedfg5k2p60l9djcmw0ue5l8fhc'
    and m.event_attributes:"0_position_idx"::string is NOT NULL
    Run a query to Download Data