Query editor
-- =================================================================-- UNIFIED VIEW: vw.hyperoute_txs_base-- =================================================================-- DESCRIPTION: The following query functions as a unified View of all-- txs (deposit, withdraw, harvest) for HYPE & USD₮0 strategies.-- =================================================================WITH-- ------------------------------------------------------------------- SECTION 1: Extract HYPE Strategy data (using `hyperevm.logs`)-- -----------------------------------------------------------------vw_hype_strategy_txs AS (WITHevent_signatures(signature_hash, event_name) AS (VALUES(0x91ede45f04a37a7c170f5c1207df3b6bc748dc1e04ad5e917a241d0f52feada3, 'Deposit'),(0x94ffd6b85c71b847775c89ef6496b93cee961bdc6ff827fd117f174f06f745ae, 'Withdraw'),(0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c, 'Token-Deposited'),(0x7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65, 'Token-Withdrawn')),log_actions AS (SELECT L.tx_hash, ES.event_name AS action_type, L.block_time, L.tx_fromFROM hyperevm.logs AS LINNER JOIN event_signatures AS ES ON L.topic0 = ES.signature_hashWHERE L.tx_to = 0x1e9756bf8058f75a71543f6bc4b8bc9029237460 -- HYPE Strategy AddressAND ES.event_name IN ('Deposit', 'Withdraw')),log_data_parsed AS (SELECTL.tx_hash, ES.event_name AS data_type, L.contract_address AS token_address, bytearray_to_uint256(bytearray_substring(L."data", 1, 32)) AS amount_rawFROM hyperevm.logs AS LINNER JOIN event_signatures AS ES ON L.topic0 = ES.signature_hashWHERE ES.event_name IN ('Token-Deposited', 'Token-Withdrawn'))SELECTA.block_time, A.tx_hash, A.action_type AS evt_type, 'HYPE Strategy' AS strategy_name, A.tx_from AS user_address, 'WHYPE' AS token_symbol, (D.amount_raw / POWER(10, 18)) * (CASE WHEN A.action_type = 'Deposit' THEN 1 ELSE -1 END) AS amountFROM log_actions AS AINNER JOIN log_data_parsed AS D ON A.tx_hash = D.tx_hashAND ((A.action_type = 'Deposit' AND D.data_type = 'Token-Deposited') OR (A.action_type = 'Withdraw' AND D.data_type = 'Token-Withdrawn'))),-- ------------------------------------------------------------------- SECTION 2: Extract USD₮0 Strategy data (from `hyperevm.traces`)-- -----------------------------------------------------------------vw_usdt0_strategy_txs AS (WITHmethod_selectors(selector, name) AS (VALUES(0xf1215d25, 'Deposit'), (0x2e1a7d4d, 'Withdraw'))