andurilPayments/Commerce Data - Programs and Transfers
    Updated 2024-11-12
    with programs_agg as (
    select
    date_trunc('month',block_timestamp) as month,
    CASE
    when program_id in (
    'ENicYBBNZQ91toN7ggmTxnDGZW14uv9UkumN7XBGeYJ4',
    '3KPRuKWxV6PtneZXbokMBwdF4T9brCFx7FcmKJ2tPqqt') then 'Helio'
    when program_id = 'FD1amxhTsDpwzoVX41dxp2ygAESURV2zdUACzxM1Dfw9' then 'Coinflow'
    else 'Unknown' end as label,
    count(distinct tx_id) as txs,
    count(distinct signers[0]) as wallets
    from
    solana.core.fact_events
    where
    month between '2023-01-01' and date_trunc('month', current_date())
    and succeeded
    and program_id in
    (
    'ENicYBBNZQ91toN7ggmTxnDGZW14uv9UkumN7XBGeYJ4',
    '3KPRuKWxV6PtneZXbokMBwdF4T9brCFx7FcmKJ2tPqqt',
    'FD1amxhTsDpwzoVX41dxp2ygAESURV2zdUACzxM1Dfw9'
    )
    group by
    month,label
    ),


    transfers_agg as (
    select
    date_trunc('month', block_timestamp) as month,
    case when tx_from = 'DhEsUaJkT1DzkFUWLCkU21VruJQZk1es4zBRhU9QjK9R' then 'Stripe'
    when tx_from = 'Ffreyan5HfFkzZi8ACDYQs4KH7hURmzeJAWHrcpggnUe' then 'Sphere'
    else 'Unknown' end as label,
    count(distinct tx_id) as txs,
    count(distinct tx_to) as wallets
    from
    QueryRunArchived: QueryRun has been archived