ben-wyattoptimism-tx-value-graph
    Updated 2025-01-27
    -- forked from Avalanche-tx-value-graph @ https://flipsidecrypto.xyz/studio/queries/8133a2f0-f254-4096-b62e-2e369ad89ebb

    -- 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
    optimism.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
    optimism.price.ez_prices_hourly
    WHERE
    symbol = 'ETH' 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
    Last run: 2 months ago
    TRANSACTION_MONTH
    TRANSACTION_SIZE
    TX_VALUE_USD
    TX_VALUE_NATIVE
    TX_COUNT
    UNIQUE_USERS
    1
    2022-01-01 00:00:00.000Large88228914.93637229342.902217926349141
    2
    2022-01-01 00:00:00.000Small146207807.71497249546.259072506126065728248
    3
    2022-02-01 00:00:00.000Large39851654.929414314226.64813981511159
    4
    2022-02-01 00:00:00.000Small82502905.71400628822.11229351293779827375
    5
    2022-03-01 00:00:00.000Large51860608.588738818934.838367619166121
    6
    2022-03-01 00:00:00.000Small82975343.25000928574.166381957115142837583
    7
    2022-04-01 00:00:00.000Large99174577.521631932425.557452663377200
    8
    2022-04-01 00:00:00.000Small170566566.5679155666.728877293168252373068
    9
    2022-05-01 00:00:00.000Large53884208.808672825209.22832179521391
    10
    2022-05-01 00:00:00.000Small166721697.50578977669.9003343832781316122184
    11
    2022-06-01 00:00:00.000Large221877864.710577144094.768206672801210
    12
    2022-06-01 00:00:00.000Small328595360.607383218221.2504248313950427331755
    13
    2022-07-01 00:00:00.000Large85906058.224626759904.128996691329123
    14
    2022-07-01 00:00:00.000Small157839664.719363112542.2599676823437218194695
    15
    2022-08-01 00:00:00.000Large757660447.973911452605.0301272951328372
    16
    2022-08-01 00:00:00.000Small407724453.598241242198.4357100434395293188362
    17
    2022-09-01 00:00:00.000Large570826728.575286388189.193949424847339
    18
    2022-09-01 00:00:00.000Small262405953.63371174477.4595769225184541204586
    19
    2022-10-01 00:00:00.000Large239980938.840789170808.697518637659212
    20
    2022-10-01 00:00:00.000Small197045850.341619143145.3973692276617931266615
    72
    6KB
    40s