ben-wyattBSC-tx-value-graph
    Updated 2025-01-27
    -- forked from Arbitrum-tx-value-graph @ https://flipsidecrypto.xyz/studio/queries/4a560ac4-7e4a-411c-bf36-20ce7d99a88e

    -- 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
    bsc.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
    bsc.price.ez_prices_hourly
    WHERE
    symbol = 'BNB' 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: 3 months ago
    TRANSACTION_MONTH
    TRANSACTION_SIZE
    TX_VALUE_USD
    TX_VALUE_NATIVE
    TX_COUNT
    UNIQUE_USERS
    1
    2022-01-01 00:00:00.000Large14736687961.730433032800.1813121222665609
    2
    2022-01-01 00:00:00.000Small11134329732.53625039335.870665919207457610241354
    3
    2022-02-01 00:00:00.000Large9580259436.1769224125108.1901952162654953
    4
    2022-02-01 00:00:00.000Small8761351566.7410122192619.51922091564963148488919
    5
    2022-03-01 00:00:00.000Large11093038414.09427811666.2356742166175298
    6
    2022-03-01 00:00:00.000Small8679971632.3846921801797.80145841578674149530706
    7
    2022-04-01 00:00:00.000Large7088966735.4632417080381.9573526137294826
    8
    2022-04-01 00:00:00.000Small9872512941.5310623644655.45519411506171179658610
    9
    2022-05-01 00:00:00.000Large8317444609.9205425148129.437604138033204
    10
    2022-05-01 00:00:00.000Small10945689706.221833971533.57510161533372308892458
    11
    2022-06-01 00:00:00.000Large3397678661.5720713830243.540866960951934
    12
    2022-06-01 00:00:00.000Small5084873339.9777620513973.48561631194454367657279
    13
    2022-07-01 00:00:00.000Large2068733903.1768270444.5166800544841244
    14
    2022-07-01 00:00:00.000Small3969075216.1160615994540.94459821147692857626278
    15
    2022-08-01 00:00:00.000Large2411809522.71418000283.4857767453641502
    16
    2022-08-01 00:00:00.000Small4177403276.9708513726201.87646861000853707394591
    17
    2022-09-01 00:00:00.000Large2395776462.604238586440.1473081345391285
    18
    2022-09-01 00:00:00.000Small3091605130.2607811122498.495499975637689268161
    19
    2022-10-01 00:00:00.000Large3132422537.7393110482360.199528547811787
    20
    2022-10-01 00:00:00.000Small2924953095.0478110323407.125736210598613811676385
    72
    6KB
    462s