MuzeDrift Cross Over
    Updated 2023-10-03
    -- forked from Cross Over Transactions @ https://flipsidecrypto.xyz/edit/queries/ea5e58d1-fc4c-423e-8e88-e118bff9deeb


    with users as (
    select
    distinct signers[0] as user

    from solana.core.fact_events events
    where program_id = 'dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH'
    and succeeded
    and block_timestamp >= '2023-01-01'
    )

    -- final as (
    select
    c.label,
    count( distinct a.signers[0] ) as users,
    count( distinct a.tx_id ) as transactions
    from solana.core.fact_events a
    join users b on a.signers[0] = b.user
    join solana.core.dim_labels c on a.program_id = c.address
    where a.program_id != 'dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH'
    and block_timestamp >= '2023-01-01'
    and c.blockchain = 'solana'
    and c.label != 'solana'
    and c.label != 'drift'
    and succeeded
    group by 1
    order by users desc
    limit 10




    Run a query to Download Data