Updated 2024-10-20
    WITH CurrentPeriod AS (
    SELECT
    swaps.tx_hash AS SwapTxHash,
    swaps.platform AS PlatformName,
    swaps.amount_in_usd AS TotalVolumeUSD,
    core.tx_fee AS TxFeeMATIC,
    swaps.origin_from_address AS Swapper
    FROM
    polygon.defi.ez_dex_swaps AS swaps
    LEFT JOIN
    polygon.core.fact_transactions AS core
    ON
    swaps.tx_hash = core.tx_hash
    WHERE
    swaps.block_timestamp >= DATEADD(MONTH, -3, CURRENT_DATE)
    AND swaps.block_timestamp < CURRENT_DATE
    AND swaps.platform = 'quickswap-v3'
    ),
    PreviousPeriod AS (
    SELECT
    swaps.tx_hash AS SwapTxHash,
    swaps.platform AS PlatformName,
    swaps.amount_in_usd AS TotalVolumeUSD,
    core.tx_fee AS TxFeeMATIC,
    swaps.origin_from_address AS Swapper
    FROM
    polygon.defi.ez_dex_swaps AS swaps
    LEFT JOIN
    polygon.core.fact_transactions AS core
    ON
    swaps.tx_hash = core.tx_hash
    WHERE
    swaps.block_timestamp >= DATEADD(MONTH, -6, CURRENT_DATE)
    AND swaps.block_timestamp < DATEADD(MONTH, -3, CURRENT_DATE)
    AND swaps.platform = 'quickswap-v3'
    ),
    QueryRunArchived: QueryRun has been archived