boomer77value of collateral over time
    Updated 2021-12-12
    with bluna_p as (
    SELECT
    date(block_timestamp) as dt,
    msg_value:execute_msg:send:amount /POW(10,6) as collateral_provide,
    'bLUNA' as basset
    FROM terra.msgs
    WHERE msg_value:execute_msg:send:msg:deposit_collateral IS NOT NULL
    and msg_value:contract::string = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'
    and tx_status = 'SUCCEEDED'),

    bluna_w as (select date(block_timestamp) as dt,
    msg_value:execute_msg:withdraw_collateral:amount/1e6 as amount_withdraw,
    'bLUNA' as basset
    from terra.msgs
    where msg_value:execute_msg:withdraw_collateral is not null
    and msg_value:contract::string = 'terra1ptjp2vfjrwh0j0faj9r6katm640kgjxnwwq9kn'
    and tx_status = 'SUCCEEDED'),

    beth_p as (
    SELECT
    date(block_timestamp) as dt,
    msg_value:execute_msg:send:amount /POW(10,6) as collateral_provide,
    'bETH' as basset
    FROM terra.msgs
    WHERE msg_value:execute_msg:send:msg:deposit_collateral IS NOT NULL
    and msg_value:contract::string = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun'
    and tx_status = 'SUCCEEDED'),

    beth_w as (select date(block_timestamp) as dt,
    msg_value:execute_msg:withdraw_collateral:amount/1e6 as amount_withdraw,
    'bETH' as basset
    from terra.msgs
    where msg_value:execute_msg:withdraw_collateral is not null
    and msg_value:contract::string = 'terra10cxuzggyvvv44magvrh3thpdnk9cmlgk93gmx2'
    and tx_status = 'SUCCEEDED'),

    Run a query to Download Data