winnie-fs2023-04-26 03:04 PM
    Updated 2023-04-26
    with

    bgum_mints as (

    select

    block_timestamp,
    tx_id,
    fee,
    instruction :accounts[8] ::string as collection_mint,
    count(1) as mints

    from solana.core.fact_events
    inner join solana.core.fact_transactions txs
    using(tx_id, block_timestamp, succeeded)
    where succeeded
    and program_id = 'BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY'
    and array_contains('Program log: Instruction: MintToCollectionV1' ::variant, log_messages)
    and block_timestamp > '2023-02-07'
    group by 1,2,3,4

    union all

    select
    block_timestamp,
    tx_id,
    fee,
    f.value :accounts[8] ::string as collection_mint,
    count(1) as mints
    from solana.core.fact_events
    inner join lateral flatten (input => inner_instruction :instructions) f
    inner join solana.core.fact_transactions txs
    using(tx_id, block_timestamp, succeeded)
    where succeeded
    Run a query to Download Data