libruaryFloor price - Flowty
    Updated 2024-10-04
    WITH ListingEvents AS (
    SELECT
    block_timestamp,
    event_contract,
    event_type,
    event_data:listingResourceID::STRING AS listing_id,
    event_data:nftID::STRING AS nft_id,
    event_data:salePrice::FLOAT AS sale_price,
    event_data:buyer::STRING AS buyer,
    event_data:storefrontAddress::STRING AS seller,
    event_data:purchased::BOOLEAN AS is_purchased,
    event_data:nftType::STRING AS nft_type,
    event_data:salePaymentVaultType::STRING AS payment_type
    FROM
    flow.core.fact_events
    WHERE
    event_contract = 'A.3cdbb3d569211ff3.NFTStorefrontV2'
    AND event_type = 'ListingCompleted'
    AND event_data:nftType = 'A.0b2a3299cc857e29.TopShot.NFT' -- Only include TopShot NFTs
    AND event_data:salePaymentVaultType = 'A.ead892083b3e2c6c.DapperUtilityCoin.Vault' -- Only DapperUtilityCoin sales
    )

    -- Filtering for only completed purchases with sale prices under $1
    , PurchasedListings AS (
    SELECT
    block_timestamp,
    nft_id,
    sale_price,
    buyer,
    seller
    FROM
    ListingEvents
    WHERE
    is_purchased = TRUE -- Only include completed sales
    AND sale_price <= 1.0 -- Only include sales of $1 or less
    )
    QueryRunArchived: QueryRun has been archived