shreyash-5873Anchor Total Deposits
    Updated 2021-08-18
    with daily_stable_deposits as (
    select
    block_id,
    sum(m.msg_value:coins[0]:amount) / pow(10, 6) as total_stable_deposits
    from terra.msgs m
    where m.msg_value:execute_msg:deposit_stable is not null
    and tx_status = 'SUCCEEDED'
    group by 1
    ),
    daily_stable_withdrawals as (
    select
    block_id,
    sum(m.msg_value:execute_msg:send:amount) / pow(10, 6) as total_stable_withdrawals
    from terra.msgs m
    where m.msg_value:execute_msg:send:msg:redeem_stable is not null
    and tx_status = 'SUCCEEDED'
    group by 1
    ),
    daily_deposits as (
    select
    d.block_id,
    total_stable_deposits,
    total_stable_withdrawals
    from daily_stable_deposits d
    full outer join daily_stable_withdrawals w
    on d.block_id = w.block_id
    )
    select * from daily_deposits
    order by block_id


    Run a query to Download Data