datavortexdexalot weekly
    Updated 2025-03-29
    WITH txs AS (
    SELECT
    DATE_TRUNC('hour', block_timestamp) AS "Date Hour",
    tx_hash AS "Transaction Hash",
    origin_from_address AS "Sender",
    origin_to_address AS "Receiver",
    decoded_log,
    CASE
    WHEN decoded_log:to = '0x1fd108cf42a59c635bd4703b8dbc8a741ff834be' THEN decoded_log:from
    WHEN decoded_log:from = '0x1fd108cf42a59c635bd4703b8dbc8a741ff834be' THEN decoded_log:to
    END AS "Bridger",
    contract_address::STRING AS "Token Address",
    CASE
    WHEN decoded_log:to = '0x1fd108cf42a59c635bd4703b8dbc8a741ff834be' THEN 'Deposit'
    WHEN decoded_log:from = '0x1fd108cf42a59c635bd4703b8dbc8a741ff834be' THEN 'Withdraw'
    END AS "Flow Direction",
    decoded_log:value AS "Raw Transfer Value"
    FROM avalanche.core.ez_decoded_event_logs
    WHERE event_name = 'Transfer'
    AND (decoded_log:to = '0x1fd108cf42a59c635bd4703b8dbc8a741ff834be' OR decoded_log:from = '0x1fd108cf42a59c635bd4703b8dbc8a741ff834be')
    ),

    px_tb AS (
    SELECT
    token_address AS "Token Address",
    symbol AS "Symbol",
    decimals AS "Decimals",
    DATE_TRUNC('hour', hour) AS "Date Hour",
    price AS "Token Price (USD)"
    FROM avalanche.price.ez_prices_hourly
    ),

    enriched_dfk AS (
    SELECT
    DATE_TRUNC('week', txs."Date Hour") AS "Week", -- Changed to week-level aggregation
    txs."Date Hour",
    Last run: 3 months ago
    Week
    Total Unique Bridge Transactions
    Total Unique Bridgers
    Total Inflow (USD)
    Total Outflow (USD)
    Net Flow (USD)
    1
    2023-01-16 00:00:00.000213070.97324588903070.973245889
    2
    2023-01-23 00:00:00.000301168935.147302318157.84254061768777.304761701
    3
    2023-01-30 00:00:00.0007623281067170.78309899151553.048869496915617.734229493
    4
    2023-02-06 00:00:00.000440178277122.377552945160640.024482415116482.353070529
    5
    2023-02-13 00:00:00.000601257527212.311714794136217.627139164390994.68457563
    6
    2023-02-20 00:00:00.000501202301926.85837928189328.87964508112597.9787342
    7
    2023-02-27 00:00:00.000297130151919.6397932283727.96363680268191.676156418
    8
    2023-03-06 00:00:00.00027197185635.81595695175931.1286073779704.687349573
    9
    2023-03-13 00:00:00.000253106169604.699978272124634.56830620144970.131672071
    10
    2023-03-20 00:00:00.00026598200394.57921999998490.294537673101904.284682326
    11
    2023-03-27 00:00:00.000611178121495.710671433146781.775905385-25286.065233951
    12
    2023-04-03 00:00:00.000472118234584.5944167988798.562492375145786.031924415
    13
    2023-04-10 00:00:00.000452101126113.30441910967630.50827175558482.796147354
    14
    2023-04-17 00:00:00.000448101164596.183681255144783.13037284819813.053308407
    15
    2023-04-24 00:00:00.0001450155239383.713332336129787.218672638109596.494659698
    16
    2023-05-01 00:00:00.0002488030535.37259989749237.703885216-18702.331285319
    17
    2023-05-08 00:00:00.00022275108646.79520930189451.22796454819195.567244753
    18
    2023-05-15 00:00:00.000678166191077.759856992168948.03083555322129.729021439
    19
    2023-05-22 00:00:00.000789346361098.780904151350174.91333272210923.867571429
    20
    2023-05-29 00:00:00.000850409499772.316017337523510.138975589-23737.822958253
    ...
    115
    10KB
    17s