maybeyonasanc_basset_bals
    Updated 2022-01-29
    with
    lock_collat as (
    select distinct
    block_timestamp,
    tx_id,
    msg_value:sender::string as user,
    case msg_value:execute_msg:lock_collateral:collaterals[0][0]::string
    when 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' then 'bluna'
    when 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' then 'beth'
    end as collateral,
    msg_value:execute_msg:lock_collateral:collaterals[0][1]::string/pow(10,6) as amount,
    amount as vector
    from terra.msgs
    where tx_status = 'SUCCEEDED'
    and msg_value:execute_msg:lock_collateral:collaterals[0][0]::string in (
    'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp', -- bluna
    'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' -- beth
    )
    and msg_value:contract::string = 'terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8' --overseer
    ),
    unlock_collat as (
    select distinct
    block_timestamp,
    tx_id,
    msg_value:sender::string as user,
    case msg_value:execute_msg:lock_collateral:collaterals[0][0]::string
    when 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' then 'bluna'
    when 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' then 'beth'
    end as collateral,
    msg_value:execute_msg:unlock_collateral:collaterals[0][1]::string/pow(10,6) as amount,
    -amount as vector
    from terra.msgs
    where tx_status = 'SUCCEEDED'
    and msg_value:execute_msg:lock_collateral:collaterals[0][0]::string in (
    'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp', -- bluna
    'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' -- beth
    Run a query to Download Data