MLDZMNprograms1
    Updated 2023-05-05
    -- forked from programs1 @ https://flipsidecrypto.xyz/edit/queries/d87f3572-b0fd-4578-9c42-b6fbeab6827b


    with t1 as (select
    distinct tx_to as wallets
    from solana.core.fact_transfers s
    inner join solana.core.fact_events e
    using(block_timestamp, tx_id)
    where succeeded
    and e.program_id = '1atrmQs3eq1N2FEYWu6tyTXbCjP4uQwExpjtnhXtS8h' -- migration lazy transactions
    and signers[0] = 'mgrArTL62g582wWV6iM4fwU1LKnbUikDN6akKJ76pzK'
    and mint in (
    'hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux', -- HNT
    'iotEVVZLEywoTn1QdwNPddxPWszn3zFhEot3MfL9fns', -- IOT
    'mb1eu7TzEc71KxDpsmsKoucSSuuoGLv1drys1oP2jh6', -- MOBILE
    'dcuc8Amr83Wz27ZkQ2K9NS6r8zRpf1J6cvArEBDZDmm', -- DC
    'So11111111111111111111111111111111111111112' -- SOL
    )
    and block_timestamp >= '2023-04-18'
    )

    select
    b.LABEL as programs,
    count(distinct a.signers[0]) as users,
    count(distinct a.tx_id) as no_txn
    from solana.core.fact_transactions a
    left join solana.core.dim_labels b on a.instructions[0]:programId = b.address
    join t1 c on a.signers[0] = c.wallets
    where block_timestamp>= '2023-04-18'
    and label_subtype != 'token_contract'
    and label != 'solana'
    and succeeded = TRUE
    and signers[0] in (select wallets from t1)
    group by 1
    order by 3 desc limit 10


    Run a query to Download Data