marquonly1.core.creator_passes
    Updated 2024-07-01
    with

    pass_create_txs as (

    select

    block_timestamp as last_timestamp
    , first_value(block_timestamp) over (partition by fact_events.instruction :accounts[5] ::string order by block_timestamp) as created_timestamp
    , tx_id
    , fact_events.instruction :accounts[3] ::string as creator_address
    , coalesce(
    decoded_instruction :args :createMetadataAccountArgsV2 :data :name
    , decoded_instruction :args :updateMetadataAccountArgsV2 :data :name
    , decoded_instruction :args :createMetadataAccountArgsV3 :data :name
    ) ::string as pass_name
    , fact_events.instruction :accounts[5] ::string as mint
    from solana.core.fact_events
    inner join solana.core.fact_decoded_instructions
    using(block_timestamp, tx_id)
    where succeeded
    and fact_events.program_id = 'pssZn3LTGJpknPtSDiqLXZq98VwfYVicy6zDfPu82Cs'
    and fact_decoded_instructions.program_id = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'
    and len(utils.udf_base58_to_hex(instruction :data)) > 4
    and block_timestamp > '2023-04-03'

    qualify row_number() over (partition by mint order by block_timestamp desc) = 1
    )

    select *
    from pass_create_txs
    order by created_timestamp desc
    QueryRunArchived: QueryRun has been archived