Pine Analyticsglad-lime copy copy
    Updated 2025-05-26
    -- forked from glad-lime copy @ https://flipsidecrypto.xyz/studio/queries/3af47c5c-7ed7-4e97-b4bd-3c4414c6f3e7

    with tab1 as (
    select
    date_trunc('hour', block_timestamp) as hour,
    tx_from as wallet,
    'in' as flow,
    amount
    from solana.core.fact_transfers
    where mint like '9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump'
    and tx_to like '9SLPTL41SPsYkgdsMzdfJsxymEANKr5bYoBsQzJyKpKS'
    union all
    select
    date_trunc('hour', block_timestamp) as hour,
    tx_to as wallet,
    'out' as flow,
    amount
    from solana.core.fact_transfers
    where mint like '9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump'
    and tx_from like '9SLPTL41SPsYkgdsMzdfJsxymEANKr5bYoBsQzJyKpKS'
    )


    select
    tab1.hour,
    flow as token_flow,
    count(*) as events,
    count(distinct wallet) as wallets,
    sum(amount * price) as volume_usd

    from tab1
    left outer join (select * from solana.price.ez_prices_hourly where token_address like '9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump') as a
    Last run: about 2 months ago
    HOUR
    TOKEN_FLOW
    EVENTS
    WALLETS
    VOLUME_USD
    1
    2025-05-13 23:00:00.000in2819232954.92768684
    2
    2025-05-22 15:00:00.000in552913.50890754
    3
    2025-05-23 16:00:00.000out21420799.85077248
    4
    2025-05-21 21:00:00.000out112950.98706
    5
    2025-05-23 21:00:00.000in1135.19
    6
    2025-05-18 22:00:00.000in2227193.923205
    7
    2025-05-12 17:00:00.000in762668.80000417
    8
    2025-05-16 16:00:00.000out33103.73632896
    9
    2025-05-16 10:00:00.000in33164.55303625
    10
    2025-05-17 16:00:00.000in2259542.8
    11
    2025-05-24 10:00:00.000in22667.5599987
    12
    2025-05-13 04:00:00.000in44279.44426469
    13
    2025-05-18 11:00:00.000in222816.00000128
    14
    2025-05-19 18:00:00.000out1112886.84404212
    15
    2025-05-25 23:00:00.000out11
    16
    2025-05-22 05:00:00.000in33131.2694917
    17
    2025-05-24 14:00:00.000in44135.81916192
    18
    2025-05-11 12:00:00.000out11297.93163752
    19
    2025-05-15 06:00:00.000in994374.5000052
    20
    2025-05-15 01:00:00.000out22741852.69220965
    ...
    441
    22KB
    34s