Query editor
WITH normalized AS (SELECT coalesce(lbPair, lb_pair) AS pool, coalesce(tokenX, token_x) AS token_x,coalesce(tokenY, token_y) AS token_y, coalesce(binStep, bin_step) AS bin_step_bps,evt_block_time AS birth_time, evt_block_slot AS birth_slot, coalesce(evt_tx_index, 0) AS tx_index,coalesce(evt_outer_instruction_index, 0) AS outer_index, coalesce(evt_inner_instruction_index, -1) AS inner_index,evt_tx_id AS birth_tx, evt_tx_signer AS birth_signer,row_number() OVER (PARTITION BY coalesce(lbPair, lb_pair) ORDER BY evt_block_slot, coalesce(evt_tx_index, 0), coalesce(evt_outer_instruction_index, 0), coalesce(evt_inner_instruction_index, -1)) AS rnFROM dlmm_solana.lb_clmm_evt_lbpaircreateWHERE evt_block_date >= current_date - INTERVAL '7' DAYAND evt_block_time >= CAST(current_timestamp AS timestamp) - INTERVAL '7' DAYAND evt_executing_account = 'LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo'AND coalesce(lbPair, lb_pair) IS NOT NULL)SELECT pool, token_x, token_y, bin_step_bps, birth_time, birth_slot, tx_index, outer_index, inner_index, birth_tx, birth_signer,CASE WHEN token_x IN ('So11111111111111111111111111111111111111112', 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v') AND token_y IN ('So11111111111111111111111111111111111111112', 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v') THEN NULLWHEN token_x IN ('So11111111111111111111111111111111111111112', 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v') THEN token_yWHEN token_y IN ('So11111111111111111111111111111111111111112', 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v') THEN token_x END AS focus_mint,CASE WHEN token_x IN ('So11111111111111111111111111111111111111112', 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v') OR token_y IN ('So11111111111111111111111111111111111111112', 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v') THEN 'SOL/USDC quote present' ELSE 'outside primary quote scope' END AS quote_scope,CAST(current_timestamp AS timestamp) AS materialized_atFROM normalized WHERE rn = 1;