alessio9567IXS Swap Volume Weekly % Change by chain
    Updated 2024-10-11
    WITH ixs_swaps AS (
    SELECT
    DATE_TRUNC('week', block_timestamp) AS week,
    'ethereum' AS chain,
    platform AS dex,
    contract_address as pool_address,
    CONCAT(symbol_in, '-', symbol_out) AS pool_pair,
    SUM(COALESCE(amount_in_usd, amount_out_usd)) AS weekly_volume_usd
    FROM
    ethereum.defi.ez_dex_swaps
    WHERE
    (
    symbol_in = 'IXS'
    OR symbol_out = 'IXS'
    )
    AND amount_in_usd IS NOT NULL
    AND amount_out_usd IS NOT NULL
    GROUP BY
    week,
    chain,
    dex,
    pool_address,
    pool_pair
    UNION
    all
    SELECT
    DATE_TRUNC('week', block_timestamp) AS week,
    'polygon' AS chain,
    platform AS dex,
    contract_address as pool_address,
    CONCAT(symbol_in, '-', symbol_out) AS pool_pair,
    SUM(COALESCE(amount_in_usd, amount_out_usd)) AS weekly_volume_usd
    FROM
    polygon.defi.ez_dex_swaps
    WHERE
    QueryRunArchived: QueryRun has been archived