messariGetting Started copy
    Updated 2024-11-22
    WITH
    txs AS (
    SELECT
    BLOCK_TIMESTAMP,
    instructions
    FROM
    solana.core.fact_transactions
    WHERE
    succeeded = TRUE
    -- array_contains(account_keys, 'vBoNdEvzMrSai7is21XgVYik65mqtaKXuSdMBJ1xkW4'::variant)
    AND BLOCK_TIMESTAMP > date_trunc('month', dateadd('month', -1, CURRENT_DATE))
    AND BLOCK_TIMESTAMP < date_trunc('month', CURRENT_DATE)
    AND CAST(LOG_MESSAGES AS STRING) LIKE '%ClaimSettlement%'
    )
    SELECT
    *
    FROM
    txs,
    LATERAL FLATTEN(INPUT => instructions) ixs,
    WHERE 1=1
    AND ixs.VALUE:programId = 'vBoNdEvzMrSai7is21XgVYik65mqtaKXuSdMBJ1xkW4'
    AND '89SrbjbuNyqSqAALKBsKBqMSh463eLvzS4iVWCeArBgB' = utils.udf_hex_to_base58(concat('0x', SUBSTRING(utils.udf_base58_to_hex(ixs.VALUE:DATA), LENGTH(utils.udf_base58_to_hex(ixs.VALUE:DATA)) - 2 * (8 + 8 + 32) + 1, 2 * 32)))

    QueryRunArchived: QueryRun has been archived