PapasotCOSG daily swap volume
    Updated 2023-01-03
    -- Show the number of trades to Cosmic Champs and from Cosmic Champs by day? Also chart the volume of trades to Cosmic Champs and from Cosmic Champs by day?


    select
    date_trunc('day',block_timestamp) as block_day,
    count(swap_from_asset_id) as Swaps_from_COSG,
    sum(swap_from_amount) as Swaps_from_COSG_volume,
    count(swap_to_asset_id) as Swaps_to_COSG,
    sum(swap_to_amount) as Swaps_to_COSG_volume,
    swap_program
    from algorand.swaps

    where block_timestamp >= '2022-01-01' AND
    (swap_to_asset_id = 571576867 OR
    swap_from_asset_id = 571576867)
    group by block_day, swap_program
    order by block_day
    Run a query to Download Data