mattkstewChain Comparison 2
    Updated 2023-07-30
    with tab_Avalance as (
    SELECT
    date_trunc('day', block_timestamp) AS "Date (Day)",
    'Avalanche' as Chain,
    count(distinct tx_hash) AS Swaps,
    count(distinct origin_from_address) AS Unique_Swappers,
    sum(case when amount_in_usd is null then amount_out_usd else amount_in_usd end) AS Volume_USD,
    sum(case when amount_in_usd is null then amount_out_usd else amount_in_usd end) * .003 AS Fee_Volume_USD
    FROM avalanche.core.ez_dex_swaps
    WHERE platform = 'uniswap-v3'
    AND (AMOUNT_IN_USD between AMOUNT_OUT_USD - 5000 and AMOUNT_OUT_USD + 5000) -- I got this from Masi's Dashboard (https://flipsidecrypto.xyz/Masi/uniswap-s-role-in-avalanche-s-defi-growth-m6D9n6) who Credited it to "Abbas from old Dashboards"
    and block_timestamp >= '2023-07-13' -- Started on first day over 5k in Swap volume
    GROUP BY 1
    )

    , tab_Ethereum as (
    select
    date_trunc('day', block_timestamp) AS "Date (Day)",
    'Ethereum' as Chain,
    count(distinct tx_hash) AS Swaps,
    count(distinct sender) AS Unique_Swappers,
    sum(case when AMOUNT1_USD < 0 then AMOUNT1_USD * -1 end) AS Volume_USD,
    sum(case when AMOUNT1_USD < 0 then AMOUNT1_USD * -1 end) * .003 AS Fee_Volume_USD

    from ethereum.uniswapv3.ez_swaps
    where block_timestamp >= '2023-07-13'
    group by 1,2
    )

    , tab_Polygon as (
    select
    date_trunc('day', block_timestamp) AS "Date (Day)",
    'Polygon' as Chain,
    count(distinct tx_hash) AS Swaps,
    count(distinct sender) AS Unique_Swappers,
    sum(case when amount_in_usd is null then amount_out_usd else amount_in_usd end) AS Volume_USD,
    Run a query to Download Data