Query editor
WITH--Only tokens to trackTokenPrices as(SELECTblockchain,timestamp ,contract_address,decimals,priceFROM prices.dayWHEREsymbol IN ('WETH', 'USDC', 'USD₮0')AND timestamp >= timestamp '2025-09-01'),-- chain namesChains (chainId, chainName) as ( values(0, 'Internal'),(1, 'Mainnet'),(56, 'BNB'),(8453, 'Base'),(42161, 'Internal'), -- arbitrum(43114, 'Internal') -- avax),BridgeOps 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'),Final as (SELECTbo.chain,bo.time_date,c.chainName as srcChain,bo.amount_in * tp.price / pow(10,tp.decimals) as amount_in_usd,-bo.amount_out * tp.price / pow(10,tp.decimals) as amount_out_usd-- tp.price_avg,-- t.decimals,-- t.symbol