Query editor
WITH gate_solana_txs AS (SELECTblock_date,id AS tx_hashFROM solana.transactionsWHERE block_date >= DATE('2026-02-28')AND success = trueAND (CONTAINS(account_keys, '4w3DZU3zBu7149sTmEZ2XFTNxuvuX3F9f9heQFi6YtS6')-- OR CONTAINS(account_keys, '2rwUXt3JeyPtUBjH5pscZLRDBoh9WADfXq7gyoDnLcC4'))GROUP BY 1,2-- UNION-- SELECT-- block_date,-- tx_id AS tx_hash-- FROM solana.account_activity-- WHERE block_date >= DATE('2026-02-28')-- AND tx_success-- AND address = 'BmDFarMxxp6ZBMZc768iWXbSEiGBVb4UvnE7hEUG7at7' -- dex fee address-- AND balance_change > 0-- GROUP BY 1,2),dex_ranked AS (SELECTg.block_date,s.block_time,DATE_TRUNC('hour', s.block_time) AS block_hour,'solana' AS blockchain,COALESCE(s.project, 'gate_solana_unparsed') AS project,COALESCE(s.token_pair, 'unparsed') AS token_pair,g.tx_hash,s.trader_id AS tx_from,COALESCE(s.amount_usd, 0) AS amount_usd,ROW_NUMBER() OVER (PARTITION BY g.tx_hashORDER BYCASE WHEN s.tx_id IS NOT NULL THEN 1 ELSE 0 END DESC,s.amount_usd DESC NULLS LAST,s.outer_instruction_index DESC NULLS LAST,s.inner_instruction_index DESC NULLS LAST,s.tx_index DESC NULLS LAST) AS rnFROM gate_solana_txs gLEFT JOIN dex_solana.trades sON s.tx_id = g.tx_hashAND s.block_month >= DATE('2026-02-01')AND s.block_date >= DATE('2026-02-28')AND s.amount_usd IS NOT NULL)SELECTblock_date,block_time,block_hour,blockchain,project,