nitsYLDLY inflow and outflow
    Updated 2022-05-21
    with outflow as
    (SELECT date(block_timestamp) as day, sum(swap_from_amount) as total_amt,
    sum(total_amt) over (order by day) as cumulative_amt, 'outflow' as type
    from algorand.swaps
    where swap_from_asset_id = '226701642' and date(block_timestamp)>= '2022-01-01'
    GROUP by 1 ),
    inflow as
    (SELECT date(block_timestamp) as day, sum(swap_to_amount) as total_amt,
    sum(total_amt) over (order by day) as cumulative_amt, 'inflow' as type
    from algorand.swaps
    where swap_to_asset_id = '226701642' and date(block_timestamp)>= '2022-01-01'
    GROUP by 1 )


    SELECT * from outflow
    UNION ALL
    SELECT * from inflow
    limit 1000
    Run a query to Download Data