ben-wyattAvalanche-tx-value-graph
    Updated 2025-01-27
    -- grabs transactions, joins on hourly price data
    -- "Large" transactions are > $100k
    -- Make sure to check what the token of account for the fact_transactions.value column is.
    WITH transaction_data AS (
    SELECT
    value as native_value,
    block_timestamp,
    DATE_TRUNC('hour', block_timestamp) AS rounded_hour,
    from_address
    FROM
    avalanche.core.fact_transactions
    WHERE
    block_timestamp BETWEEN '2022-01-01' AND '2024-12-31 23:59:59'
    ),
    price_data AS (
    SELECT
    symbol,
    price,
    hour
    FROM
    avalanche.price.ez_prices_hourly
    WHERE
    symbol = 'AVAX' and
    hour BETWEEN '2022-01-01' AND '2024-12-31 23:59:59'
    ),
    transactions_with_prices AS (
    SELECT
    t.native_value,
    t.rounded_hour,
    t.from_address,
    p.price,
    t.native_value * COALESCE(p.price, 0) AS usd_value,
    DATE_TRUNC('month', t.rounded_hour) AS rounded_month,
    CASE
    WHEN t.native_value * COALESCE(p.price, 0) > 100000 THEN 'Large'
    ELSE 'Small'
    Last run: 3 months ago
    TRANSACTION_MONTH
    TRANSACTION_SIZE
    TX_VALUE_USD
    TX_VALUE_NATIVE
    TX_COUNT
    UNIQUE_USERS
    1
    2022-01-01 00:00:00.000Large11782576707.5352142839854.844277244542670
    2
    2022-01-01 00:00:00.000Small8469451227.58491104886814.1625447663758712748
    3
    2022-02-01 00:00:00.000Large13162852569.4131161752547.876532267862785
    4
    2022-02-01 00:00:00.000Small7497794834.9873793171428.297294754619496599528
    5
    2022-03-01 00:00:00.000Large12271543822.6208152252207.469873216322277
    6
    2022-03-01 00:00:00.000Small6101813353.1581775522646.959364953244088605978
    7
    2022-04-01 00:00:00.000Large10116147950.3005124466746.359113154462030
    8
    2022-04-01 00:00:00.000Small4450962108.8251455381409.840197650315474552145
    9
    2022-05-01 00:00:00.000Large5939568884.22324163376691.642257122461301
    10
    2022-05-01 00:00:00.000Small4076501666.5354115809134.66313732796854545166
    11
    2022-06-01 00:00:00.000Large2528657523.75845129706189.2601036266741
    12
    2022-06-01 00:00:00.000Small2138428972.96061111101286.68042914833596338381
    13
    2022-07-01 00:00:00.000Large1786990246.0127685735585.64877544368596
    14
    2022-07-01 00:00:00.000Small1657858964.8370180457712.147506512995568335804
    15
    2022-08-01 00:00:00.000Large1534505109.8272863830807.08571024470622
    16
    2022-08-01 00:00:00.000Small1445325351.553960254825.813558711630478337296
    17
    2022-09-01 00:00:00.000Large1405643430.7740976090659.55919063604468
    18
    2022-09-01 00:00:00.000Small973693390.69616452300678.77132789570314270466
    19
    2022-10-01 00:00:00.000Large1057562043.3216763198943.05833713126386
    20
    2022-10-01 00:00:00.000Small806973846.55419748469807.837603110160572481325
    72
    6KB
    48s