KaskoazulYawww - NFT collections
    Updated 2022-05-09
    with YAWWW_TXS as (
    select tx_id
    from solana.fact_events
    where block_timestamp >= '2022-04-01'
    and program_id = '76f9QiXhCc8YLJc2LEE4Uae4Xu3itc3JCGLmup3VQwRH' --Yawww.io
    ),

    NFT_LOANS as (
    select ft.block_timestamp::date as fecha,
    case nft.project_name
    when NULL then 'Not identified'
    else nft.project_name
    end as NFT_collection,
    count(ft.tx_id) as number_of_loans
    from solana.fact_transactions ft
    left join solana.dim_nft_metadata nft
    on ft.post_token_balances[0]:mint = nft.mint
    where fecha >= '2022-04-01'
    and ft.tx_id IN (select tx_id from YAWWW_TXS)
    and ft.succeeded = 'TRUE'
    and ft.log_messages[1] = 'Program log: Instruction: Accept loan request'
    group by 1,2
    ),

    PAID_LOANS as (
    select ft.block_timestamp::date as fecha,
    case nft.project_name
    when NULL then 'Not identified'
    else nft.project_name
    end as NFT_collection,
    count(ft.tx_id) as number_of_loans
    from solana.fact_transactions ft
    left join solana.dim_nft_metadata nft
    on ft.post_token_balances[0]:mint = nft.mint
    where fecha >= '2022-04-01'
    and ft.tx_id IN (select tx_id from YAWWW_TXS)
    Run a query to Download Data