Updated 2025-02-07
    -- forked from unit-query @ https://flipsidecrypto.xyz/studio/queries/54460826-0a26-461a-b81d-22a6d8da4cb8

    --this combines the ez_native_transfer and the ez_token_transfer tables together
    --grabs the amount_usd values and does a little bit of by-row analysis


    SELECT
    DATE_TRUNC('month', block_timestamp) AS rounded_month,
    COUNT(DISTINCT from_address) AS unique_users,
    SUM(amount_usd) AS tx_vol_usd,
    COUNT(*) AS tx_count,
    CASE
    WHEN amount_usd > 100000 THEN 'Large'
    ELSE 'Small'
    END AS transaction_size
    FROM (
    SELECT
    block_timestamp,
    from_address,
    amount_usd
    FROM base.core.ez_token_transfers
    WHERE block_timestamp BETWEEN '2022-01-01' AND '2024-12-31'
    UNION ALL
    SELECT
    block_timestamp,
    from_address,
    amount_usd,
    FROM base.core.ez_native_transfers
    WHERE block_timestamp BETWEEN '2022-01-01' AND '2024-12-31'
    ) AS combined_transfers
    where amount_usd < 1e9
    GROUP BY
    rounded_month,
    transaction_size
    Last run: 2 months ago
    ROUNDED_MONTH
    UNIQUE_USERS
    TX_VOL_USD
    TX_COUNT
    TRANSACTION_SIZE
    1
    2023-06-01 00:00:00.0001825634.73255615648Small
    2
    2023-07-01 00:00:00.000146260005080.045341773Large
    3
    2023-07-01 00:00:00.0001451711353367445.671244440399Small
    4
    2023-08-01 00:00:00.00012603186651241.3713811883Large
    5
    2023-08-01 00:00:00.0008451909026592899.1520633142582Small
    6
    2023-09-01 00:00:00.00010824054072888.419159085Large
    7
    2023-09-01 00:00:00.0007359286071642997.6873322574820Small
    8
    2023-10-01 00:00:00.0008632313432652.948035860Large
    9
    2023-10-01 00:00:00.0008148526396210006.883123204521Small
    10
    2023-11-01 00:00:00.0007581943786701.477086170Large
    11
    2023-11-01 00:00:00.0006276117419048559.4447217574568Small
    12
    2023-12-01 00:00:00.00013324245139288.8112911201Large
    13
    2023-12-01 00:00:00.0007543209179484949.4740316651827Small
    14
    2024-01-01 00:00:00.00012354120112073.6133311334Large
    15
    2024-01-01 00:00:00.0007819578505970308.6261520711814Small
    16
    2024-02-01 00:00:00.00013734008574087.4810210252Large
    17
    2024-02-01 00:00:00.000102898511049582970.163324822887Small
    18
    2024-03-01 00:00:00.000566517693969793.641945006Large
    19
    2024-03-01 00:00:00.000231791845295246179.951467921138Small
    20
    2024-04-01 00:00:00.000734231223133891.80671728Large
    37
    2KB
    122s