saeedmzn[Flowty marketplace] - Quarterly metrics
    Updated 2025-02-08
    with Offer_trasnactions as (
    select
    BLOCK_TIMESTAMP::date date ,
    tx_id ,
    event_data:offerAddress::STRING buyer,
    event_data:acceptingAddress::STRING seller ,
    event_data:"offerAmount"::float amount
    FROM
    FLOW.CORE.FACT_EVENTS
    WHERE TX_SUCCEEDED
    and EVENT_CONTRACT = 'A.b8ea91944fd51c43.OffersV2'
    and EVENT_DATA :: STRING ilike '%0x6590f8918060ef13%'
    and EVENT_TYPE = 'OfferCompleted'
    and BLOCK_TIMESTAMP::date >= '2024-01-01'
    and EVENT_DATA:purchased ='true'
    )
    ,
    listing_transactions as (
    select BLOCK_TIMESTAMP::date date ,
    tx_id ,
    EVENT_DATA:buyer :: STRING buyer ,
    EVENT_DATA:storefrontAddress :: STRING seller ,
    EVENT_DATA:"salePrice"::float amount
    FROM
    FLOW.CORE.FACT_EVENTS
    WHERE TX_SUCCEEDED
    and EVENT_CONTRACT = 'A.3cdbb3d569211ff3.NFTStorefrontV2'
    and EVENT_TYPE = 'ListingCompleted'
    and EVENT_DATA:purchased = 'true'
    and BLOCK_TIMESTAMP::date >= '2024-01-01'
    ),
    final as (
    select 'Offers' type , * from Offer_trasnactions
    UNION
    select 'Listings' type , * from listing_transactions
    )
    QueryRunArchived: QueryRun has been archived