Query editor
-- JUPITER LEND LIQUIDATIONS (BASE TABLE)WITH liq_keys AS (SELECTblock_time,outer_instruction_index,tx_idFROM solana.instruction_callsWHERE executing_account = 'jupr81YtYssSyPt8jbnGuiWon5f6x9TcDEFxYe3Bdzi'AND substr("data", 1, 8) = from_hex('dfb3e27d302e274a')AND inner_instruction_index IS NULLAND tx_success = TRUEAND block_time >= TIMESTAMP '2025-10-03 00:00:00 UTC'AND block_time < TIMESTAMP '2025-10-17 00:00:00 UTC'),-- Using the txn IDs, select all inner instructionsinners_raw AS (SELECTa.block_time,a.tx_id,a.account_arguments,a.outer_instruction_index,a.inner_instruction_index,a."data" AS inner_dataFROM solana.instruction_calls aJOIN liq_keys bON a.tx_id = b.tx_idAND a.outer_instruction_index = b.outer_instruction_indexWHERE a.inner_instruction_index IS NOT NULLAND a.block_time >= TIMESTAMP '2025-10-03 00:00:00 UTC'AND a.block_time < TIMESTAMP '2025-10-17 00:00:00 UTC'),-- Only grab the Jupiter Lend Liquidity: operate instructions-- (8-byte discriminator d96ad06374972a87)operate_ranked AS (SELECTtx_id,outer_instruction_index,inner_instruction_index,inner_data,ROW_NUMBER() OVER (PARTITION BY tx_id, outer_instruction_indexORDER BY inner_instruction_index ASC) AS rnFROM inners_rawWHERE substr(inner_data, 1, 8) = from_hex('d96ad06374972a87')),op_decoded AS (SELECTtx_id,outer_instruction_index,rn,-- arg1_i128: first i128 argument (bytes 9..16, little-endian)CAST(from_big_endian_64(reverse(substr(inner_data, 9, 8))) AS DECIMAL(38, 0)