i_danWoofi: Weekly
    Updated 2025-02-11
    SELECT
    date_trunc('week', block_timestamp) AS "Week"
    , Count(*) AS "Transactions"
    , SUM("Transactions") OVER (ORDER BY "Week") AS "Cummulative Transactions"
    , Count(DISTINCT origin_from_address) AS "Swappers"
    , SUM(CASE WHEN amount_in_usd IS NULL THEN amount_out_usd ELSE amount_in_usd END) AS "Volume"
    , SUM("Volume") OVER (ORDER BY "Week") AS "Cummulative Volume"
    , COUNT(DISTINCT symbol) AS "Tokens"
    , COUNT(DISTINCT pool_name) AS "Pairs"
    FROM (
    SELECT
    block_timestamp
    , platform
    , symbol_in AS symbol
    , origin_from_address
    , pool_name
    , amount_in_usd
    , amount_out_usd
    FROM avalanche.defi.ez_dex_swaps
    WHERE platform = 'woofi'
    UNION ALL
    SELECT
    block_timestamp
    , platform
    , symbol_out AS symbol
    , origin_from_address
    , pool_name
    , amount_in_usd
    , amount_out_usd
    FROM avalanche.defi.ez_dex_swaps
    WHERE platform = 'woofi'
    )
    GROUP BY 1
    ORDER BY 1 DESC
    QueryRunArchived: QueryRun has been archived