nnnnnnpf-act_with-bund
    Updated 2025-02-25
    with devs_launch_tokens as (
    SELECT
    block_id,
    TO_CHAR(block_timestamp, 'DD/MM HH24:MI:SS') as block_timestamp,
    tx_id,
    DECODED_INSTRUCTION:accounts[7]:pubkey::string as devs,
    DECODED_INSTRUCTION:accounts[0]:pubkey::string as ca,
    block_timestamp as raw_timestamp
    from
    solana.core.fact_decoded_instructions
    where
    event_type = 'create'
    and program_id = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'
    and DECODED_INSTRUCTION:accounts[0]:pubkey = '{{ca}}'
    ),

    bundle_buy_transactions as (
    SELECT
    block_id,
    block_timestamp,
    tx_id,
    trader,
    token_amt,
    round((token_amt / 1000000000) * 100, 4) as token_amt_pct,
    sol_amt,
    ca,
    raw_timestamp
    FROM (
    SELECT
    fdi.block_id as block_id,
    TO_CHAR(fdi.block_timestamp, 'DD/MM HH24:MI:SS') as block_timestamp,
    fdi.tx_id,
    fs.swapper as trader,
    fs.swap_to_amount as token_amt,
    fs.swap_from_amount as sol_amt, -- Adjust sol_amt calculation as needed
    fs.swap_to_mint as ca,
    QueryRunArchived: QueryRun has been archived