shreyash-5873Anchor: New Deposits
    Updated 2021-08-27
    with daily_deposit_increases as (
    select
    date(block_timestamp) as block_date,
    sum(m.msg_value:coins[0]:amount / pow(10, 6)) as deposit_amount_usd
    from terra.msgs m
    where m.msg_value:contract::string = 'terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s'
    and msg_value:execute_msg:deposit_stable is not null
    and tx_status = 'SUCCEEDED'
    group by 1
    ),
    borrow_stables as (
    select
    date(block_timestamp) as block_date,
    sum(m.msg_value:execute_msg:borrow_stable:borrow_amount / pow(10, 6)) as borrow_amount_usd
    from terra.msgs m
    where m.msg_value:contract::string = 'terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s'
    and msg_value:execute_msg:borrow_stable is not null
    and tx_status = 'SUCCEEDED'
    group by 1
    )
    select
    d.block_date,
    deposit_amount_usd,
    borrow_amount_usd
    from daily_deposit_increases d
    inner join borrow_stables b
    on d.block_date = b.block_date




    Run a query to Download Data