Query editor
WITH graduated AS (SELECTtoken,min(block_time) as graduated_dateFROM (SELECTblock_time,account_arguments[3] AS tokenFROM solana.instruction_callsWHEREexecuting_account = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'AND BYTEARRAY_SUBSTRING(data, 1, 8) = 0x9beae792ec9ea21eAND block_slot >= 328034480AND tx_successAND account_arguments[3] IS NOT NULL -- Added NULL checkUNIONSELECTblock_time,account_arguments[2] AS tokenFROM solana.instruction_callsWHEREexecuting_account = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'AND BYTEARRAY_SUBSTRING(data, 1, 8) = 0x9beae792ec9ea21eAND block_slot >= 328034480AND tx_successAND account_arguments[2] IS NOT NULL -- Added NULL check)GROUP BY 1),withdraws AS (SELECTblock_time,account_arguments[3] AS token_addressFROM solana.instruction_callsWHEREexecuting_account = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'AND BYTEARRAY_SUBSTRING(data, 1, 8) = 0xb712469c946da122AND tx_success = TRUEAND account_arguments[3] IS NOT NULL -- Added NULL checkUNIONSELECTblock_time,account_arguments[2] AS token_addressFROM solana.instruction_callsWHEREexecuting_account = '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'AND BYTEARRAY_SUBSTRING(data, 1, 8) = 0xb712469c946da122AND tx_success = TRUEAND account_arguments[2] IS NOT NULL -- Added NULL check),all_tokens AS (SELECT DISTINCT token AS token_address FROM graduatedWHERE token IS NOT NULLUNIONSELECT DISTINCT token_address FROM withdrawsWHERE token_address IS NOT NULL),-- Get the most recent price within the last 24 hours for each tokenrecent_prices AS (SELECT