permarymarine-gold
    Updated 2025-04-02
    -- Common table for collection offers/settle offers
    WITH order_fulfilled_raw AS (
    SELECT
    decoded_log,
    decoded_log:offer:buyer::string AS buyer_address,
    decoded_log:offer:collection::string AS nft_address,
    decoded_log:offer:paymentToken::string AS payment_token,
    decoded_log:offer:isERC721::boolean AS is_721,
    decoded_log:order:seller::string AS seller_address,
    decoded_log:order:value::int AS total_price_per_order,
    decoded_log:newFulfilledAmount::int AS count_per_order,
    event_name,
    event_index,
    block_timestamp,
    tx_hash,
    topic_0
    FROM ronin.core.ez_decoded_event_logs
    WHERE block_timestamp::date >= '2025-01-01'
    AND block_timestamp::date < '2025-04-01'
    AND contract_address = '0x3ef234bc2a04d86f6041e419458d9acbd077f2c1'
    AND event_name = 'OrderFulfilled'
    ),

    order_fulfilled_nfts AS (
    SELECT
    tx_hash,
    event_index,
    index AS intra_event_index,
    value::string AS token_id
    FROM order_fulfilled_raw, LATERAL FLATTEN (input => decoded_log:order:ids)
    ),

    order_fulfilled_nft_count AS (
    SELECT
    tx_hash,
    event_index,
    Last run: 2 months ago
    NO_OF_SALES
    DAILY_VOLUME_USD
    DAILY_FEES_USD
    TOTAL_SELLERS
    TOTAL_BUYERS
    1
    1603638522514.6454319439820.1392404932910420261
    1
    55B
    79s