Query editor
WITH decoded_swap AS (SELECTtx_id,block_time,CASEWHEN varbinary_starts_with(data, 0xe445a52e51cb9a1d3e2f370aa503dc2a) THEN 'sell'WHEN varbinary_starts_with(data, 0xe445a52e51cb9a1d67f4521f2cf57777) THEN 'buy'ELSE 'unknown'END AS trade_type,bytearray_to_uint256(bytearray_reverse(bytearray_substring(data, 17, 4))) AS timestamp,bytearray_to_uint256(bytearray_reverse(bytearray_substring(data, 65, 8))) AS poolQuoteTokenReserves,bytearray_to_uint256(bytearray_reverse(bytearray_substring(data, 73, 8))) AS quoteAmountOutorIn,bytearray_to_uint256(bytearray_reverse(bytearray_substring(data, 89, 8))) AS lpFee,bytearray_to_uint256(bytearray_reverse(bytearray_substring(data, 97, 8))) AS protocolFeeBasisPoints,bytearray_to_uint256(bytearray_reverse(bytearray_substring(data, 105, 8))) AS protocolFee,bytearray_to_uint256(bytearray_reverse(bytearray_substring(data, 113, 8))) AS quoteAmountOutorInWithoutLpFee,bytearray_to_uint256(bytearray_reverse(bytearray_substring(data, 121, 6))) AS userQuoteAmountOutorIn,to_base58(bytearray_substring(data, 129, 32)) AS pool,to_base58(bytearray_substring(data, 161, 32)) AS user,to_base58(bytearray_substring(data, 193, 32)) AS userBaseTokenAccount,to_base58(bytearray_substring(data, 225, 32)) AS userQuoteTokenAccount,to_base58(bytearray_substring(data, 257, 32)) AS protocolFeeRecipient,to_base58(bytearray_substring(data, 289, 32)) AS protocolFeeRecipientTokenAccountFROM solana.instruction_callsWHERE tx_success = trueAND inner_executing_account = 'pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA'AND (varbinary_starts_with(data, 0xe445a52e51cb9a1d3e2f370aa503dc2a) ORvarbinary_starts_with(data, 0xe445a52e51cb9a1d67f4521f2cf57777)))SELECT *FROM decoded_swap;