datavortexWeekly Swap Volume
    Updated 2025-03-06
    WITH swap_events AS (
    SELECT
    tx_hash,
    origin_to_address AS pool_address,
    block_timestamp,
    DATE_TRUNC('week', block_timestamp) AS swap_week
    FROM
    ink.core.ez_decoded_event_logs
    WHERE
    event_name = 'Swap'
    AND origin_to_address = '0xa8c1c38ff57428e5c3a34e0899be5cb385476507'
    AND block_timestamp IS NOT NULL
    AND tx_succeeded = TRUE
    ),

    token_transfers AS (
    SELECT
    tx_hash,
    contract_address,
    symbol,
    amount_usd
    FROM
    ink.core.ez_token_transfers
    ),

    amounts_with_weth AS (
    SELECT
    t1.tx_hash,
    t1.contract_address,
    t1.symbol,
    t1.amount_usd,
    MAX(CASE WHEN LOWER(t2.symbol) = 'weth' THEN t2.amount_usd END)
    OVER (PARTITION BY t1.tx_hash) AS weth_amount_usd,
    ROW_NUMBER() OVER (PARTITION BY t1.tx_hash ORDER BY LOWER(t1.symbol) ASC) AS row_num
    FROM
    token_transfers t1
    Last run: 2 months ago
    weekly
    weekly swap volume usd
    cumulative swap volume usd
    1
    2024-12-23 00:00:00.000117491.18117491.18
    2
    2024-12-30 00:00:00.000222432.01339923.19
    3
    2025-01-06 00:00:00.000539913.21879836.4
    4
    2025-01-13 00:00:00.000339750.381219586.78
    5
    2025-01-20 00:00:00.000751018.381970605.16
    6
    2025-01-27 00:00:00.0001421046.573391651.73
    7
    2025-02-03 00:00:00.000714148.194105799.92
    8
    2025-02-10 00:00:00.000502805.924608605.84
    9
    2025-02-17 00:00:00.000309708.54918314.34
    10
    2025-02-24 00:00:00.000206838.515125152.85
    11
    2025-03-03 00:00:00.00063166.665188319.51
    11
    535B
    28s