datavortexnew vs returning
    Updated 2025-03-31
    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
    NEW_SWAPPERS
    RETURNING_SWAPPERS
    CUMULATIVE_SWAPS
    CUMULATIVE_SWAP_VOLUME
    CUMULATIVE_SWAPPERS
    CUMULATIVE_NEW_SWAPPERS
    CUMULATIVE_RETURNING_SWAPPERS
    1
    2022-10-10 00:00:00.0007116229.575381032151507116229.57538103215150
    2
    2022-10-17 00:00:00.00017247087.53354418826161024363317.10892522413110
    3
    2022-10-24 00:00:00.000434147892.410816704301515677211209.519741925714625
    4
    2022-10-31 00:00:00.000408200170.2610413032411131085411379.780783228955738
    5
    2022-11-07 00:00:00.0001267673851.97614365640192123521085231.756926881357659
    6
    2022-11-14 00:00:00.000441182854.0527824092251727931268085.809709291578176
    7
    2022-11-21 00:00:00.000314120987.5759786892141731071389073.385687981788593
    8
    2022-11-28 00:00:00.000242118883.028952482031733491507956.4146404619888110
    9
    2022-12-05 00:00:00.00017069875.2768083261861235191577831.6914487921694122
    10
    2022-12-12 00:00:00.000261142266.2159515352642237801720097.9074003224298144
    11
    2022-12-19 00:00:00.000328103873.25555836366511541081823971.16295869308149159
    12
    2022-12-26 00:00:00.00024495996.99523051838241443521919968.1581892346173173
    13
    2023-01-02 00:00:00.000548200365.85710308485632249002120334.01529229431236195
    14
    2023-01-09 00:00:00.000360178373.2415028852432152602298707.25679517455239216
    15
    2023-01-16 00:00:00.000376223656.9590008671831556362522364.21579604473242231
    16
    2023-01-23 00:00:00.000418294594.5035543112251760542816958.71935035495247248
    17
    2023-01-30 00:00:00.000369252527.0663479442542164233069485.7856983520251269
    18
    2023-02-06 00:00:00.000344247085.2074079772141767673316570.99310627541255286
    19
    2023-02-13 00:00:00.000300201957.1639471322942570673518528.1570534570259311
    20
    2023-02-20 00:00:00.000498352087.7802646452552075653870615.93731805595264331
    ...
    130
    12KB
    99s