messariDialect Mints and Collectors copy
    Updated 2023-07-06
    -- forked from anduril / Dialect Mints and Collectors @ https://flipsidecrypto.xyz/anduril/q/RURwH5GLWw3x/dialect-mints-and-collectors

    with
    compression_txs as (
    select distinct
    tx_id
    from
    solana.core.fact_events
    where
    date(block_timestamp) >= '2023-03-10'
    and program_id = 'BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY'
    and signers[0] = '4WCBsTL4fHpg8qCt1wxoqRzgj2CZepdpmS5NaaoxPUJh'
    )
    select
    date(block_timestamp) as date,
    -- log_messages[1] as instruction,
    count(distinct tx_id) as mints,
    count(distinct signers[0]) as deployers,
    count(distinct instructions[0]:accounts[1]) as collectors,
    sum(mints) over (order by date) as total_mints,
    sum(fee) / pow(10, 9) as fees
    from
    solana.core.fact_transactions
    inner join compression_txs using (tx_id)
    where
    date(block_timestamp) >= '2023-03-10'
    and (
    log_messages[1] = 'Program log: Instruction: MintToCollectionV1'
    OR log_messages[1] = 'Program log: Instruction: MintV1'
    )
    and succeeded
    group by
    1


    Run a query to Download Data