Updated 2024-05-13
    SELECT
    date_trunc(week, block_timestamp) as date,
    count(DISTINCT tx_id) as N_loan,
    split_part(EVENT_DATA:nftType, '.', 3) as C_name,
    sum(N_loan) over (order by date) as Cumulative_loan,
    sum(EVENT_DATA:amount) as listing_loanVolume,
    sum(listing_loanVolume) over (order by date) as Cumulative_volume
    FROM flow.core.fact_events
    WHERE EVENT_CONTRACT = 'A.5c57f79c6694797f.Flowty' AND EVENT_TYPE = 'ListingAvailable'
    AND TX_SUCCEEDED = 'true'
    GROUP BY 1,3


    QueryRunArchived: QueryRun has been archived