Eman-RazMaximum Swap Volume ($USD)
    Updated 2023-05-15
    ----------------------------------------PEPE,SHIB,CHAD------------------------------------------------------

    WITH DATA1 AS (with final_tab as
    (WITH SELL AS (select date_trunc('day',block_timestamp) as day, symbol_in,
    count(distinct origin_from_address) as SELLER_COUNT,
    sum(amount_in_usd) as SELL_VOLUME_USD, count(distinct tx_hash) as selling_count
    from ethereum.core.ez_dex_swaps
    where (TOKEN_IN=lower('0x6982508145454Ce325dDbE47a25d4ec3d2311933') OR -- PEPE
    TOKEN_IN=lower('0x6B89B97169a797d94F057F4a0B01E2cA303155e4') OR --CHAD
    TOKEN_IN=lower('0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce')) -- SHIB

    group by 1,2
    order by 1),

    BUY AS (select date_trunc('day',block_timestamp) as day, symbol_out,
    count(distinct origin_from_address) as BUYER_COUNT, sum(amount_OUT_usd) as BUY_VOLUME_USD, count(distinct tx_hash) as BUYING_count
    from ethereum.core.ez_dex_swaps
    where (TOKEN_out=lower('0x6982508145454Ce325dDbE47a25d4ec3d2311933') OR -- PEPE
    TOKEN_out=lower('0x6B89B97169a797d94F057F4a0B01E2cA303155e4') OR --CHAD
    TOKEN_out=lower('0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce')) -- SHIB

    group by 1,2
    order by 1)

    SELECT SELL.DAY AS "Date", SELL_VOLUME_USD+BUY_VOLUME_USD as "Swap Volume", selling_count+BUYING_count as "Swap Count",
    symbol_in as "Symbol"
    from sell left join buy on sell.day=buy.day and sell.symbol_in=buy.symbol_out
    order by 1)

    select "Symbol", max("Swap Volume") as "Maximum", AVG("Swap Volume") as "Average",
    median("Swap Volume") as "Median", min("Swap Volume") as "Minimum"
    from final_tab
    group by 1),

    --------------------------------------------DOGE----------------------------------------------------------

    Run a query to Download Data