gaael1999swap to or swap from
    Updated 2022-04-28
    with a as(select date_trunc('day',block_timestamp) date1,sum(swap_to_amount) as volume_buy,count(tx_group_id) as trades_buy
    from algorand.swaps
    where swap_to_asset_id = '694432641'
    group by date1
    ),
    b as (select date_trunc('day',block_timestamp) date2,sum(swap_from_amount) as volume_sell,count(tx_group_id) as trades_sell
    from algorand.swaps
    where swap_from_asset_id = '694432641'
    group by date2
    )
    select volume_buy,trades_buy,volume_sell,trades_sell,DATE2
    from a
    inner join b
    on a.date1=b.date2
    group by volume_buy,trades_buy,volume_sell,trades_sell,DATE2
    Run a query to Download Data