piperautomatic-brown
    Updated 2025-01-25
    with

    mint_txs as (

    select
    block_timestamp
    , tx_id
    , account_address
    , owner
    , instruction :parsed :info :tokenAmount :amount ::int as amount
    , fact_events.instruction :parsed :info :account as token_account
    from solana.core.fact_events
    left join solana.core.fact_token_account_owners ta_owners
    on fact_events.instruction :parsed :info :account = ta_owners.account_address
    and fact_events.block_id >= ta_owners.start_block_id
    and iff(ta_owners.end_block_id is null, TRUE, fact_events.block_id <= ta_owners.end_block_id)
    where succeeded
    and program_id = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'
    and event_type = 'mintToChecked'
    and instruction :parsed :info :mint = '2DMMamkkxQ6zDMBtkFp8KH7FoWzBMBA1CGTYwom4QH6Z'
    and block_timestamp > '2024-02-02'
    -- and block_timestamp > current_timestamp - interval '24 hours'
    )

    select

    sum(amount) as units
    , count(distinct ifnull(owner, token_account)) as buyers

    from mint_txs
    Last run: 23 days ago
    UNITS
    BUYERS
    1
    156766149476
    1
    17B
    105s