TheLaughingManQuarterly Comparisons Optimized (EDGE included)
    Updated 2025-02-12
    -- forked from Quarterly Comparisons Strings+Emojis @ https://flipsidecrypto.xyz/studio/queries/ebb67ef1-188e-4ea3-9779-efc9afa8e45c

    -- forked from Quarterly Comparisons @ https://flipsidecrypto.xyz/studio/queries/a281ac54-d871-4f7f-8163-7a5460149da8



    with trades_data as (

    SELECT * EXCLUDE version, 'arbitrum' as label from arbitrum.vertex.ez_perp_trades
    WHERE 1=1
    AND (DATEDIFF('month', '{{start_date}}', block_timestamp::date) BETWEEN -9 and 2)
    -- AND trader != '0x0000000000000000000000000000000000000000'
    -- AND subaccount!='0x0000000000000000000000000000000000000000000000000000000000000001'
    UNION ALL
    ---base
    SELECT *, 'base' as label from base.vertex.ez_perp_trades
    WHERE 1=1
    AND (DATEDIFF('month', '{{start_date}}', block_timestamp::date) BETWEEN -9 and 2)
    -- AND trader != '0x0000000000000000000000000000000000000000'
    -- AND subaccount!='0x0000000000000000000000000000000000000000000000000000000000000001'

    UNION ALL
    ---blitz
    SELECT * , 'blitz' as label from blast.blitz.ez_perp_trades
    WHERE 1=1
    AND (DATEDIFF('month', '{{start_date}}', block_timestamp::date) BETWEEN -9 and 2)
    -- AND trader != '0x0000000000000000000000000000000000000000'
    -- AND subaccount!='0x0000000000000000000000000000000000000000000000000000000000000001'

    UNION ALL
    ---mantle
    SELECT * , 'mantle' as label from mantle.vertex.ez_perp_trades
    WHERE 1=1
    AND (DATEDIFF('month', '{{start_date}}', block_timestamp::date) BETWEEN -9 and 2)
    -- AND trader != '0x0000000000000000000000000000000000000000'
    QueryRunArchived: QueryRun has been archived