iboo-jbj2MVgoBTC swaps Volume and - the number of swaps over time
    Updated 2022-05-21
    with goBTC_swap_from as (
    select BLOCK_TIMESTAMP::date as date ,
    sum (SWAP_FROM_AMOUNT) as volume ,
    count (DISTINCT tx_group_id) as num_swaps
    from flipside_prod_db.algorand.swaps
    where year(BLOCK_TIMESTAMP) = '2022'
    and SWAP_FROM_AMOUNT>0
    and SWAP_FROM_ASSET_ID = 386192725
    group by 1
    ),
    goBTC_swap_to as (
    select BLOCK_TIMESTAMP::date as date ,
    sum (SWAP_to_AMOUNT) as volume ,
    count (DISTINCT tx_group_id) as num_swaps
    from flipside_prod_db.algorand.swaps
    where year(BLOCK_TIMESTAMP) = '2022'
    and SWAP_FROM_AMOUNT>0
    and SWAP_to_ASSET_ID = 386192725
    group by 1
    ),
    all_goBTC as (
    select * from goBTC_swap_from
    UNION all
    select * from goBTC_swap_to
    ),
    final_goBTC as (
    select date , sum (volume) as goBTC_volume ,
    sum (num_swaps) as goBTC_swaps
    from all_goBTC
    group by 1
    ),
    goETH_swap_from as (
    select BLOCK_TIMESTAMP::date as date ,
    sum (SWAP_FROM_AMOUNT) as volume ,
    count (DISTINCT tx_group_id) as num_swaps
    from flipside_prod_db.algorand.swaps
    Run a query to Download Data