MetiocreVolume of swaps for each stablecoin in Algo
    Updated 2022-04-11
    with assets as (
    select distinct asset_id as id, asset_name as name from algorand.asset where asset_id in ('31566704','312769','465865291')
    ),
    swapped_to as (
    SELECT swap_to_asset_id as id , sum(swap_to_asset_id) as volume
    from algorand.swaps
    where date(block_timestamp) between '2022-03-01' and '2022-04-01' and swap_to_asset_id in ('31566704','312769','465865291')
    group by swap_to_asset_id
    ),
    swapped_from as (
    SELECT swap_from_asset_id as id , sum(swap_from_asset_id) as volume
    from algorand.swaps
    where date(block_timestamp) between '2022-03-01' and '2022-04-01' and swap_from_asset_id in ('31566704','312769','465865291')
    group by swap_from_asset_id
    )
    SELECT assets.name , swapped_to.volume + swapped_from.volume as volume
    from swapped_to, swapped_from, assets
    where swapped_to.id = assets.id and swapped_to.id = swapped_from.id

    Run a query to Download Data