jackguy2023-07-14 05:41 PM
    Updated 2023-07-14
    SELECT
    date_trunc('day', block_timestamp) as day,
    'Arbitrum' as chain,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as users,
    count(DISTINCT tx_hash) as swaps

    FROM arbitrum.core.ez_dex_swaps
    WHERE block_timestamp > '2022-01-01'
    GROUP BY 1,2

    UNION

    SELECT
    date_trunc('day', block_timestamp) as day,
    'Ethereum' as chain,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as users,
    count(DISTINCT tx_hash) as swaps

    FROM ethereum.core.ez_dex_swaps
    WHERE block_timestamp > '2022-01-01'
    GROUP BY 1,2

    UNION

    SELECT
    date_trunc('day', block_timestamp) as day,
    'Polygon' as chain,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as users,
    count(DISTINCT tx_hash) as swaps

    FROM polygon.core.ez_dex_swaps
    WHERE block_timestamp > '2022-01-01'
    GROUP BY 1,2

    UNION

    Run a query to Download Data