feyikemiCumulative Volume
    Updated 2025-04-07
    WITH Price AS(
    SELECT
    HOUR::date AS Date,
    token_address,
    avg(price) AS price_usd
    FROM ronin.price.ez_prices_hourly
    GROUP BY 1,2
    ),


    NFT_TXNS AS (
    SELECT
    block_timestamp,
    tx_hash,
    from_address AS seller,
    to_address AS buyer,
    name AS collection,
    decoded_log:acceptedSettlePrice / 1e18 as nft_price,
    (decoded_log:acceptedSettlePrice / 1e18)*price_usd as nft_Price_usd
    from ronin.nft.ez_nft_transfers tr
    join ronin.core.ez_decoded_event_logs log using (tx_hash, block_timestamp)
    left join price p on block_timestamp::date = p.date and log.decoded_log:settleToken = token_address
    where event_name = 'OrderMatched'
    and decoded_log:order[0]:extraData[0][2] = token_id
    and tx_succeeded
    )
    select
    DATE_TRUNC('day', block_timestamp) AS trade_date,
    sum(nft_Price_usd) as sale_volume_usd,
    sum(sale_volume_usd) OVER (ORDER BY trade_date) AS Cumulative_Volume
    from nft_txns
    Group By 1
    ORDER BY 1 DESC
    Last run: about 2 months ago
    TRADE_DATE
    SALE_VOLUME_USD
    CUMULATIVE_VOLUME
    1
    2025-04-07 00:00:00.00041732.78403320730560740.7303505
    2
    2025-04-06 00:00:00.00067752.24802256130519007.9463173
    3
    2025-04-05 00:00:00.00048629.69060029830451255.6982947
    4
    2025-04-04 00:00:00.00062495.89496683530402626.0076944
    5
    2025-04-03 00:00:00.00070196.53407328630340130.1127276
    6
    2025-04-02 00:00:00.00094434.23334215430269933.5786543
    7
    2025-04-01 00:00:00.000116453.31317789930175499.3453122
    8
    2025-03-31 00:00:00.00090907.37064581530059046.0321343
    9
    2025-03-30 00:00:00.00064851.10411508329968138.6614885
    10
    2025-03-29 00:00:00.00063160.04646409929903287.5573734
    11
    2025-03-28 00:00:00.00063590.54551674329840127.5109093
    12
    2025-03-27 00:00:00.00087463.04923420329776536.9653925
    13
    2025-03-26 00:00:00.000124968.82775659529689073.9161583
    14
    2025-03-25 00:00:00.00096188.3671757729564105.0884017
    15
    2025-03-24 00:00:00.00091634.7474159529467916.721226
    16
    2025-03-23 00:00:00.00046856.66681696929376281.97381
    17
    2025-03-22 00:00:00.00064091.28409194829329425.3069931
    18
    2025-03-21 00:00:00.00070740.29704294329265334.0229011
    19
    2025-03-20 00:00:00.00057517.00241171429194593.7258582
    20
    2025-03-19 00:00:00.00067446.10357143129137076.7234464
    ...
    189
    11KB
    33s