Query editor
WITH spot_txns AS (SELECT 'arbitrum' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_arbitrum.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'ethereum' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_ethereum.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'optimism' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_optimism.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'polygon' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_polygon.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'avalanche' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_avalanche_c.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'bnb' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_bnb.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'fantom' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_fantom.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'gnosis' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_gnosis.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'base' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_base.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'celo' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_celo.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'zksync' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_zksync.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'blast' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_blast.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'mantle' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_mantle.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'UNION ALLSELECT 'zkevm' AS blockchain, contract_address, evt_tx_hash, evt_index, evt_block_time, evt_block_number, transactionId, integrator, referrer, receiver, fromAssetId, toAssetId, fromAmount, toAmountFROM lifi_zkevm.LiFiDiamond_v2_evt_LiFiGenericSwapCompletedWHERE integrator = 'cryptex-finance'),spot_ext AS (SELECT *