boonzadeh2024-04-23 12:05 PM
    WITH NewAccounts AS (
    SELECT
    ii.value:parsed:info:newAccount::STRING AS newAccount
    FROM
    solana.core.fact_events fe,
    LATERAL FLATTEN(input => fe.INNER_INSTRUCTION:instructions) ii
    WHERE
    date_trunc('day', fe.BLOCK_TIMESTAMP) = '2024-04-22 00:00:00.000'
    AND ii.value:parsed:type::STRING = 'createAccount'
    AND fe.PROGRAM_ID = 'FL3X2pRsQ9zHENpZSKDRREtccwJuei8yg9fwDu9UN69Q'
    AND fe.INDEX = 4
    )
    SELECT
    ft.AMOUNT,
    ft.BLOCK_ID,
    ft.BLOCK_TIMESTAMP,
    ft.FACT_TRANSFERS_ID,
    ft.INDEX,
    ft.INSERTED_TIMESTAMP,
    ft.MINT,
    ft.MODIFIED_TIMESTAMP,
    ft.TX_FROM,
    ft.TX_ID,
    ft.TX_TO
    FROM
    solana.core.fact_transfers ft
    JOIN
    NewAccounts na
    ON
    ft.TX_FROM = na.newAccount;

    Run a query to Download Data