maybeyonasabra_ust_bridge
    Updated 2021-12-22
    -- wluna = '0xd2877702675e6ceb975b4a1dff9fb7baf4c91ea9'

    -- bridge terra-side = terra13yxhrk08qvdf5zdc9ss5mwsg5sf7zva9xrgwgc

    with
    luna_price as(
    select
    date(block_timestamp) as date,
    avg(luna_exchange_rate) as luna_val
    from terra.oracle_prices
    where symbol = 'UST'
    group by 1
    ),
    luna_bridge as(
    select
    block_timestamp,
    tx_id,
    msg_value:amount[0]:amount::string/pow(10,6) as amt,
    msg_value:amount[0]:denom::string as denom,
    msg_value:from_address::string as sender
    from terra.msgs
    where msg_value:to_address::string = 'terra13yxhrk08qvdf5zdc9ss5mwsg5sf7zva9xrgwgc'
    and msg_value:amount[0]:denom::string = 'uluna'
    and tx_status = 'SUCCEEDED'
    and msg_value:amount[0]:amount::string/pow(10,6) > 0
    ),
    ust_bridge as(
    select
    block_timestamp,
    tx_id,
    msg_value:amount[0]:amount::string/pow(10,6) as amt,
    msg_value:amount[0]:denom::string as denom,
    msg_value:from_address::string as sender
    from terra.msgs
    where msg_value:to_address::string = 'terra13yxhrk08qvdf5zdc9ss5mwsg5sf7zva9xrgwgc'
    and msg_value:amount[0]:denom::string = 'uusd'
    Run a query to Download Data