Query editor
WITHBridgeOps as(SELECTchain,--evt_tx_hash,--evt_tx_from,--evt_tx_to,evt_block_date,eventName,--msgSender,split_part(substring(eventData, strpos(eventData,'"token\\\",\\\"value\\\":\\\"')+29), '\\\"}', 1) as token,IF (eventName = 'MultichainBridgeIn',split_part(substring(eventData, strpos(eventData,'"account\\\",\\\"value\\\":\\\"')+31), '\\\"}', 1),split_part(substring(eventData, strpos(eventData,'"receiver\\\",\\\"value\\\":\\\"')+32), '\\\"}', 1)) as account,cast(split_part(substring(eventData, strpos(eventData,'"srcChainId\\\",\\\"value\\\":')+30), '}\"', 1) as UINT256) as srcChainId,cast(split_part(substring(eventData, strpos(eventData,'"amount\\\",\\\"value\\\":')+26), '}\"', 1) as UINT256) as amountFROM gmx_v2_multichain.eventemitter_evt_eventlog1WHEREeventName IN ('MultichainBridgeIn', 'MultichainBridgeOut')AND evt_block_date > timestamp '2025-09-01'),/*TokenPrices as(SELECTblockchain,block_date,token,AVG((min_price + max_price) / 2) AS price_avgFROM gmx_v2.oracle_price_updateWHERECAST(token as varchar) IN (SELECT DISTINCT token FROM BridgeOps)AND block_date >= (SELECT MIN(evt_block_date) FROM BridgeOps)GROUP BY 1,2,3),*/TokenPrices_2 as(SELECTblockchain,date_value as block_date,market as token,AVG((min_price + max_price) / 2) AS price_avgFROM dune."gmx-io".result_squid_api_request_optimizedWHERE pool_type IN ('gm', 'glv')GROUP BY 1,2,3),Tokens as(SELECTblockchain,symbol,contract_address,decimalsFROM gmx_v2.erc20WHERE project = 'gmx_v2'