strawbettyUSDT, USDC, STBL swap count
    Updated 2022-04-12
    with swap_from as (
    Select
    block_timestamp::date as date,
    case
    when swap_from_asset_id = '31566704' then 'USDC'
    when swap_from_asset_id = '465865291' then 'STBL'
    when swap_from_asset_id = '312769' then 'USDT'
    end as asset,
    sum(swap_from_amount) as swap_from,
    count(*) as swap_count
    FROM algorand.swaps
    WHERE
    date >= '2022-03-01'
    and date < '2022-04-01'
    and asset is not NULL
    GROUP by 1,2
    ), swap_to as (
    Select
    block_timestamp::date as date,
    case
    when swap_to_asset_id = '31566704' then 'USDC'
    when swap_to_asset_id = '465865291' then 'STBL'
    when swap_to_asset_id = '312769' then 'USDT'
    end as asset,
    sum(swap_to_amount) as swap_to,
    count(*) as swap_count
    FROM algorand.swaps
    WHERE
    date >= '2022-03-01'
    and date < '2022-04-01'
    and asset is not NULL
    GROUP by 1,2
    )

    Select swap_from.date, swap_from.asset, swap_from, swap_to, swap_from+swap_to as total_swap, swap_from.swap_count+swap_to.swap_count as swap_count
    FROM swap_from LEFT JOIN swap_to ON swap_from.date = swap_to.date AND swap_from.asset = swap_to.asset
    Run a query to Download Data