boomer77liquidation anchor top 5
    Updated 2021-10-03
    with liq as (select
    block_timestamp, tx_id, msg_value, msg_value:execute_msg:liquidate_collateral:borrower as borrower
    from terra.msgs
    where substring(msg_value:execute_msg::string, 3, 20) = 'liquidate_collateral'
    and tx_status = 'SUCCEEDED'
    order by block_timestamp desc),

    bid as (select tx_id,
    msg_value:coins[0]:amount / POW(10, 6) as amount_ust
    from terra.msgs
    where msg_value:execute_msg:submit_bid is not null)

    select a.block_timestamp, a.tx_id, b.borrower, b.amount_ust
    from liq a
    join bid b on a.tx_id = b.tx_id
    order by 1 desc
    limit 10
    Run a query to Download Data