RamaharWho's That Going Across My Bridge (Redux) Osmosis
    Updated 2022-04-20
    with inflow as (select
    DATE(block_timestamp) AS dayz,
    count (distinct tx_id) as NoOfInFlowTransactions,
    count(distinct recipient) as NoOfInFlowUsers,
    sum(amount) as USTInFlowamount,
    sum(USTInFlowamount) over (order by dayz asc rows between unbounded preceding and current row) as accumulatedInFlowUST
    from terra.transfer_events
    where sender = 'terra1kq2rzz6fq2q7fsu75a9g7cpzjeanmk68wplle5'
    and currency = 'UST'
    group by 1 ),

    outflow as (select
    DATE(block_timestamp) AS dt,
    count (distinct tx_id) as NoOfOutFlowTransactions,
    count(distinct sender) as NoOfOutFlowUsers,
    sum(amount) as USTOutFlowamount,
    sum(USTOutFlowamount) over (order by dt asc rows between unbounded preceding and current row) as accumulatedOutFlowUST
    from terra.transfer_events
    where recipient = 'terra1kq2rzz6fq2q7fsu75a9g7cpzjeanmk68wplle5'
    and currency = 'UST'
    group by 1)

    select
    dayz,
    NoOfInFlowTransactions,
    NoOfInFlowUsers,
    USTInFlowamount,
    accumulatedInFlowUST,
    NoOfOutFlowTransactions,
    NoOfOutFlowUsers,
    USTOutFlowamount,
    accumulatedOutFlowUST
    from inflow
    left join outflow ON dayz=dt

    Run a query to Download Data