binhachonMarket Module - API
    Updated 2022-04-04
    with UST_mint_burn as (
    select
    block_id,
    block_timestamp,
    -msg_value:execute_msg:assert_limit_order:minimum_receive::float/1e6 as delta_UST -- Burn LUNA mint UST
    from terra.msgs
    where msg_value:contract::string = 'terra1vs9jr7pxuqwct3j29lez3pfetuu8xmq7tk3lzk'
    and msg_value:execute_msg:assert_limit_order:ask_denom::string = 'uusd'
    and tx_status = 'SUCCEEDED'
    union all
    select
    block_id,
    block_timestamp,
    msg_value:execute_msg:assert_limit_order:offer_coin:amount::float/1e6 as delta_UST -- Burn UST mint LUNA
    from terra.msgs
    where msg_value:contract::string = 'terra1vs9jr7pxuqwct3j29lez3pfetuu8xmq7tk3lzk'
    and msg_value:execute_msg:assert_limit_order:offer_coin:denom::string = 'uusd'
    and tx_status = 'SUCCEEDED'
    ),
    blocks as (
    select
    distinct block_id
    from terra.blocks
    where block_timestamp::date = '2022-03-15'
    ),
    UST_mint_burn_with_blocks as (
    select
    blocks.block_id,
    block_timestamp,
    sum(coalesce(delta_UST, 0)) as delta_UST
    from blocks
    left join UST_mint_burn on (UST_mint_burn.block_id = blocks.block_id)
    group by 1, 2
    ),
    cumulative_UST_mint_burn as (
    select
    Run a query to Download Data