Query editor
WITHerc20_bridging_0xa9059cbb_source AS (selectetr.blockchain AS sourceChain, etr.block_time, pfd.symbol AS tokenSymbolOnSource--, VARBINARY_TO_UINT256(SUBSTR(etr."data", 37, 32))/POW(10, pfd.decimals) AS amountReal, (VARBINARY_TO_UINT256(SUBSTR(etr."data", 37, 32))/POW(10, pfd.decimals)) * pfd.price AS amountUsd, VARBINARY_TO_UINT256(SUBSTR(etr."data", 37, 32)) AS amount, etr."from" AS bridgor, etr."to" AS tokenAddressOnSource--, SUBSTR(etr."data", 65, 32) AS inputData, etr.hashFROM evms.transactions etrLEFT JOIN prices.day pfd ON etr.blockchain = pfd.blockchain AND etr."to" = pfd.contract_address AND date_trunc('day', etr.block_time) = pfd."timestamp"WHERE SUBSTR(etr."data", VARBINARY_LENGTH(etr."DATA") - 3 , 4) = 0x865d8597 --opensea's tagAND SUBSTR(etr."data", 1, 4) = 0xa9059cbbAND etr.block_time > TRY_CAST('2025-03-12 23:42' AS TIMESTAMP)AND etr.blockchain IN ('ethereum', 'abstract', 'apechain', 'arbitrum', 'avalanche_c', 'b3', 'base', 'berachain', 'blast', 'flow', 'optimism', 'polygon', 'unichain', 'ronin', 'sei', 'shape', 'zora') --hyperevm missing) --0xa9059cbb, --'f70da97812cb96acdf810712aa562db8dfa3dbef' is relaysolver -- then 'amount' comes --then 'inputdata' --then 'openseatag' --datalength 104 --to = token, native_tokens AS (SELECTblockchain, symbol, priceSourceChain, priceSourceAddress, decimalsFROM (VALUES('ethereum', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18),('abstract', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18),('apechain', 'APE', 'apechain', 0x48b62137edfa95a428d35c09e44256a739f6b557, 18),('arbitrum', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18),('avalanche_c', 'AVAX', 'avalanche_c', 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7, 18),('b3', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18),('base', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18),('berachain', 'BERA', 'berachain', 0x6969696969696969696969696969696969696969, 18),('blast', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18),('flow', 'FLOW', 'flow', 0xd3bF53DAC106A0290B0483EcBC89d40FcC961f3e, 18),('hyperevm', 'HYPE', 'hyperevm', 0x5555555555555555555555555555555555555555, 18),('optimism', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18),('polygon', 'MATIC', 'polygon', 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270, 18),('unichain', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18),('ronin', 'RON', 'ronin', 0xe514d9deb7966c8be0ca922de8a064264ea6bcd4, 18),('sei', 'SEI', 'sei', 0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7, 18),('shape', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18),('zora', 'ETH', 'ethereum', 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 18)) AS t(blockchain, symbol, priceSourceChain, priceSourceAddress, decimals)), native_bridging_source AS (selectetr.blockchain AS sourceChain, etr.block_time--, CAST(tna.symbol AS VARCHAR(5)) AS tokenSymbolOnSource, tna.symbol AS tokenSymbolOnSource--, etr."value"/POW(10, tna.decimals) AS amountReal, (etr."value"/POW(10, pfd.decimals)) * pfd.price AS amountUsd, etr."value" AS amount, etr."from" AS bridgor