Updated 2025-04-01
    WITH decoded_logs AS (
    SELECT
    l.tx_hash AS transaction_hash,
    '0x' || SUBSTR(l.topics[2], 27) AS recipient,
    '0x' || SUBSTR(l.topics[1], 27) AS sender,
    l.event_index,
    ROW_NUMBER() OVER (
    PARTITION BY l.tx_hash
    ORDER BY l.event_index ASC
    ) AS row_num,
    l.contract_address AS pool_address,
    CAST(ethereum.public.udf_hex_to_int(SUBSTRING(l.data, 3, 64)) AS DECIMAL(38,0)) AS amount0In,
    CAST(ethereum.public.udf_hex_to_int(SUBSTRING(l.data, 67, 64)) AS DECIMAL(38,0)) AS amount1In,
    CAST(ethereum.public.udf_hex_to_int(SUBSTRING(l.data, 131, 64)) AS DECIMAL(38,0)) AS amount0Out,
    CAST(ethereum.public.udf_hex_to_int(SUBSTRING(l.data, 195, 64)) AS DECIMAL(38,0)) AS amount1Out,
    t.block_timestamp
    FROM boba.core.fact_event_logs l
    JOIN boba.core.fact_transactions t ON l.tx_hash = t.tx_hash
    WHERE l.contract_address IN (
    '0xaf3da220bc03bdbf9b0280d6e2813ea0ffe03f69',
    '0x78c6db2b6073e762f89a23eb3da71d2feeb18315',
    '0x4f059f8d45230cd5b37544e87eebba033a5f1b17',
    '0x6398a59ca706c11d02de1ea3d921742771bcd06f',
    '0xce4956c398ba118f4eacabca1b32ae97bd31df2a',
    '0x247442181b8baa03b3c7dc0d8e971bd4686db27c',
    '0x48643395833882729032170078bf7791a0999f8c',
    '0x3b444d1dbf68d1cfc64a8158affb6a24a6bdf038',
    '0x2e014fe08247a080f2ed6d230b2594911f9f9a69',
    '0x0ec9d6d21358221cccfc933530a8026038cedc12'
    )
    AND l.topics[0] = '0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822'
    ),
    pool_metadata AS (
    SELECT
    CONTRACT_ADDRESS AS pool_address,
    SYMBOL_1,
    Last run: about 1 month ago
    WEEK
    SWAPS
    SWAP_VOLUME
    SWAPPERS
    CUMULATIVE_SWAPS
    CUMULATIVE_SWAP_VOLUME
    CUMULATIVE_SWAPPERS
    1
    2022-10-10 00:00:00.0007116229.575381032157116229.57538103215
    2
    2022-10-17 00:00:00.00017247087.5335441882624363317.1089252241
    3
    2022-10-24 00:00:00.000434147892.41081670430677211209.51974192571
    4
    2022-10-31 00:00:00.000408200170.261041303241085411379.78078322895
    5
    2022-11-07 00:00:00.0001267673851.9761436574023521085231.75692688135
    6
    2022-11-14 00:00:00.000441182854.0527824092227931268085.80970929157
    7
    2022-11-21 00:00:00.000314120987.5759786892131071389073.38568798178
    8
    2022-11-28 00:00:00.000242118883.028952482033491507956.41464046198
    9
    2022-12-05 00:00:00.00017069875.2768083261835191577831.69144879216
    10
    2022-12-12 00:00:00.000261142266.2159515352637801720097.90740032242
    11
    2022-12-19 00:00:00.000328103873.2555583636641081823971.16295869308
    12
    2022-12-26 00:00:00.00024495996.9952305183843521919968.1581892346
    13
    2023-01-02 00:00:00.000548200365.8571030848549002120334.01529229431
    14
    2023-01-09 00:00:00.000360178373.2415028852452602298707.25679517455
    15
    2023-01-16 00:00:00.000376223656.9590008671856362522364.21579604473
    16
    2023-01-23 00:00:00.000418294594.5035543112260542816958.71935035495
    17
    2023-01-30 00:00:00.000369252527.0663479442564233069485.7856983520
    18
    2023-02-06 00:00:00.000344247085.2074079772167673316570.99310627541
    19
    2023-02-13 00:00:00.000300201957.1639471312970673518528.1570534570
    20
    2023-02-20 00:00:00.000498352087.7802646452575653870615.93731805595
    ...
    130
    10KB
    26s