i_dan$XSGD: Platform
    Updated 2025-03-17
    WITH trade_data AS (
    SELECT
    block_timestamp
    , tx_hash
    , origin_from_address
    , CASE WHEN token_in = lower('0xb2F85b7AB3c2b6f62DF06dE6aE7D09c010a5096E') THEN 'buy'
    WHEN token_out = lower('0xb2F85b7AB3c2b6f62DF06dE6aE7D09c010a5096E') THEN 'sell'
    END AS Action
    , CASE WHEN token_in = lower('0xb2F85b7AB3c2b6f62DF06dE6aE7D09c010a5096E') THEN symbol_in
    WHEN token_out = lower('0xb2F85b7AB3c2b6f62DF06dE6aE7D09c010a5096E') THEN symbol_out
    END AS symbol
    , CASE WHEN amount_in_usd IS NULL THEN amount_out_usd ELSE amount_in_usd END AS usd_amount
    , CASE WHEN token_in = lower('0xb2F85b7AB3c2b6f62DF06dE6aE7D09c010a5096E') THEN amount_in
    WHEN token_out = lower('0xb2F85b7AB3c2b6f62DF06dE6aE7D09c010a5096E') THEN amount_out
    END AS token_amount
    , platform
    FROM avalanche.defi.ez_dex_swaps
    WHERE token_in = lower('0xb2F85b7AB3c2b6f62DF06dE6aE7D09c010a5096E')
    OR token_out = lower('0xb2F85b7AB3c2b6f62DF06dE6aE7D09c010a5096E')
    AND usd_amount IS NOT NULL
    )

    SELECT
    platform AS "Platform"
    , COUNT(DISTINCT origin_from_address) AS "Traders"
    , SUM(usd_amount) AS "Volume Traded"
    , COUNT(tx_hash) AS "Transactions"
    , MAX(usd_amount) AS "Maximum Single Trade"
    FROM trade_data
    GROUP BY 1
    ORDER BY 3 DESC


    -- XSGD - 0xb2F85b7AB3c2b6f62DF06dE6aE7D09c010a5096E

    Last run: 16 days ago
    Platform
    Traders
    Volume Traded
    Transactions
    Maximum Single Trade
    1
    pharaoh-v22863257211274.76160770587573.98
    2
    trader-joe-v22321168296751.9164712149198.57
    3
    balancer27242212944480345.19
    4
    pangolin35269.111459.93
    4
    172B
    2s