jackguySushiswap on Arbitrum 2
    Updated 2022-08-29
    with tab1 as (
    SELECT
    symbol_out,
    count(DISTINCT tx_hash) as swaps,
    sum(amount_out_usd) as volume,
    count(ORIGIN_FROM_ADDRESS) as users
    FROM arbitrum.sushi.ez_swaps
    WHERE NOT amount_out_usd is NULL
    GROUP BY 1
    ORDER BY 3 DESC
    LIMIT 20
    )

    SELECT
    date_trunc('day', block_timestamp) as day,
    CASE WHEN symbol_out IN (SELECT symbol_out from tab1) THEN symbol_out ELSE 'other' END as swap_to_token ,
    count(DISTINCT tx_hash) as swaps,
    sum(amount_out_usd) as volume,
    count(ORIGIN_FROM_ADDRESS) as users
    FROM arbitrum.sushi.ez_swaps
    WHERE NOT amount_out_usd is NULL
    GROUP BY 1,2
    Run a query to Download Data