boomer77polygon sushi
    Updated 2022-07-12
    with lol as (select date_trunc('day', block_timestamp) as dt, pool_name, sum(amount_in_usd) as volume_usd, count(distinct tx_hash) as tx_count
    from polygon.sushi.ez_swaps
    where date(block_timestamp) = '2022-07-01' or date(block_timestamp) >= '2022-07-04' and amount_in_usd is not null
    group by 1,2

    union all

    select date_trunc('day', block_timestamp) as dt, pool_name, sum(amount_out_usd) as volume_usd, count(distinct tx_hash) as tx_count
    from polygon.sushi.ez_swaps
    where date(block_timestamp) = '2022-07-02' or date(block_timestamp) >= '2022-07-03' and amount_in_usd is not null
    group by 1,2)

    select *
    from lol
    where volume_usd is not null


    Run a query to Download Data