feyikemiscornful-ivory
    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,
    Quantity,
    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,
    count(distinct tx_hash) as nft_sales,
    count(distinct buyer) as buyers,
    count(distinct seller) as sellers,
    SUM(Quantity) AS Traded_Items,
    Round(sum(nft_Price_usd), 2) as sale_volume_usd,
    sum(sale_volume_usd) OVER (ORDER BY trade_date) AS Cumulative_Volume
    from nft_txns
    Last run: about 2 months ago
    TRADE_DATE
    NFT_SALES
    BUYERS
    SELLERS
    TRADED_ITEMS
    SALE_VOLUME_USD
    CUMULATIVE_VOLUME
    1
    2025-04-07 00:00:00.0008865166786386845270.7930564278.68
    2
    2025-04-06 00:00:00.00011725968254844867752.2530519007.89
    3
    2025-04-05 00:00:00.000124664586212519448629.6930451255.64
    4
    2025-04-04 00:00:00.000158372310957562862495.8930402625.95
    5
    2025-04-03 00:00:00.000215578612659388670196.5330340130.06
    6
    2025-04-02 00:00:00.000223787214106664294434.2330269933.53
    7
    2025-04-01 00:00:00.0002813994164655747116453.3130175499.3
    8
    2025-03-31 00:00:00.000167373510776693090907.3730059045.99
    9
    2025-03-30 00:00:00.0001700711102725869464851.129968138.62
    10
    2025-03-29 00:00:00.00016607489382483363160.0529903287.52
    11
    2025-03-28 00:00:00.00016507709602278563590.5529840127.47
    12
    2025-03-27 00:00:00.0001834873100615344287463.0529776536.92
    13
    2025-03-26 00:00:00.0002031993109748643124968.8329689073.87
    14
    2025-03-25 00:00:00.0002883126215874070696188.3729564105.04
    15
    2025-03-24 00:00:00.00027371148138112486591634.7529467916.67
    16
    2025-03-23 00:00:00.0002766120611718619346856.6729376281.92
    17
    2025-03-22 00:00:00.00028981172131211918764091.2829329425.25
    18
    2025-03-21 00:00:00.0002987115914074415670740.329265333.97
    19
    2025-03-20 00:00:00.00016576931002619205751729194593.67
    20
    2025-03-19 00:00:00.00012216739497283967446.129137076.67
    ...
    189
    13KB
    10s