Query editor
-- Generated strict cross-chain arbitrage detail SQL.-- Source chain: unichain-- Destination chain: arbitrum-- Token pairs: 5-- Core logic copied from MONAD_ARBITRUM strict v2:-- source DEX buy -> source ERC20 transfer out <= 3m-- -> destination ERC20 transfer in <= 1h-- -> destination DEX sell <= 3m-- Amount rule: raw exact match is preferred when decimals are equal; otherwise normalized destination amount must not exceed source amount and must be within tolerance.WITH params AS (SELECTTIMESTAMP '2026-01-01 00:00:00' AS start_time,CAST(date_trunc('day', current_timestamp) AS timestamp) AS end_time,100 AS min_trade_amount_usd,0.001 AS amount_tolerance),token_map AS (SELECT *FROM (VALUES('USDC', 'USDC', 0x078d782b760474a361dda0af3839290b0ef57ad6, 0xaf88d065e77c8cc2239327c5edb3a432268e5831, 6, 6, 936233978, 'lifi_asset_key_plus_active_dex_on_both_chains'),('WBTC', 'WBTC', 0x0555e30da8f98308edb960aa94c0db47230d2b9c, 0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f, 8, 8, 356776925, 'lifi_asset_key_plus_active_dex_on_both_chains'),('weETH', 'weETH', 0x7dcc39b4d1c53cb31e1abc0e358b43987fef80f7, 0x35751007a407ca6feffe80b3cb397736d2cf4dbe, 18, 18, 7820007, 'lifi_asset_key_plus_active_dex_on_both_chains'),('WETH', 'WETH', 0x4200000000000000000000000000000000000006, 0x82af49447d8a07e3bd95bd0d56f35241523fbab1, 18, 18, 886013070, 'lifi_asset_key_plus_active_dex_on_both_chains'),('wstETH', 'wstETH', 0xc02fe7317d4eb8753a02c35fe019786854a92001, 0x5979d7b546e38e414f7e9822514be443a4800529, 18, 18, 8177669, 'lifi_asset_key_plus_active_dex_on_both_chains')) AS t(asset_key,asset_symbol,source_token,destination_token,source_decimals,destination_decimals,token_map_score,token_map_evidence)),source_buys AS (SELECTm.asset_key,m.asset_symbol,m.source_token,m.destination_token,m.source_decimals,m.destination_decimals,m.token_map_score,m.token_map_evidence,t.block_time AS buy_time,t.tx_hash AS buy_tx_hash,t.tx_from AS user_address,array_join(array_agg(DISTINCT t.project), ', ') AS buy_project,array_join(array_agg(DISTINCT t.token_pair), ', ') AS buy_pair,array_join(array_agg(DISTINCT t.token_sold_symbol), ', ') AS paid_symbol,SUM(t.token_sold_amount) AS paid_amount,SUM(t.token_bought_amount) AS bought_amount,SUM(t.amount_usd) AS buy_amount_usdFROM dex.trades AS tJOIN token_map AS m