LTirrellphantom serum transfer_counts token
    Updated 2023-07-25
    -- forked from phantom serum transfer_counts @ https://flipsidecrypto.xyz/edit/queries/262ee5f1-1759-479f-9347-ad09e5d833a4

    -- forked from phantom serum examples @ https://flipsidecrypto.xyz/edit/queries/bff6ffd5-e10d-4acb-8e0f-352dad7bfced

    -- forked from phantom serum @ https://flipsidecrypto.xyz/edit/queries/6a1a8b36-5cc6-4ad4-b466-719c2ce1b414

    with serum as (
    SELECT
    block_timestamp,
    block_id,
    tx_id,
    index
    FROM
    solana.core.fact_events
    WHERE 1=1
    and block_timestamp >= current_date - 90
    and program_id = 'DeJBGdMFa1uynnnKiwrVioatTuHmNLpyFKnmB5kaFdzQ'
    and succeeded
    and index=0
    ),
    metaplex as (
    SELECT
    tx_id,
    case when tx_id in (select tx_id from serum) then 'nft_phantom'
    else 'nft_not_phantom'
    end as type
    FROM
    solana.core.fact_events
    WHERE 1=1
    and block_timestamp >= current_date - 90
    and program_id = 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s'
    and succeeded
    -- and index>1
    -- and tx_id in (select tx_id from serum)
    ),
    token as (
    Run a query to Download Data