Query editor
With pair_address as(SELECTtoken0, token1FROM uniswap_v2_ethereum.Factory_evt_PairCreatedWHERE pair = {{Pair Address DOD3}}), all_routers_02 as(SELECT call_tx_hash, path FROM uniswap_v2_ethereum.Router02_call_swapETHForExactTokensUNION ALLSELECT call_tx_hash, path FROM uniswap_v2_ethereum.Router02_call_swapExactETHForTokensUNION ALLSELECT call_tx_hash, path FROM uniswap_v2_ethereum.Router02_call_swapExactETHForTokensSupportingFeeOnTransferTokensUNION ALLSELECT call_tx_hash, path FROM uniswap_v2_ethereum.Router02_call_swapExactTokensForETHUNION ALLSELECT call_tx_hash, path FROM uniswap_v2_ethereum.Router02_call_swapExactTokensForETHSupportingFeeOnTransferTokensUNION ALLSELECT call_tx_hash, path FROM uniswap_v2_ethereum.Router02_call_swapExactTokensForTokensUNION ALLSELECT call_tx_hash, path FROM uniswap_v2_ethereum.Router02_call_swapExactTokensForTokensSupportingFeeOnTransferTokensUNION ALLSELECT call_tx_hash, path FROM uniswap_v2_ethereum.Router02_call_swapTokensForExactETHUNION ALLSELECT call_tx_hash, path FROM uniswap_v2_ethereum.Router02_call_swapTokensForExactTokens), path_indirect as(SELECTpair_addy.*, r2.path[1] as first_token, r2.path[cardinality(path)] as last_token -- cardinality tells us how many values are in our array(path). By doing this it grabs the last value., r2.call_tx_hash as tx_hash, r2.path as full_pathFROM all_routers_02 as r2, pair_address as pair_addyWHERE cardinality(r2.path) > 2AND(contains_sequence(r2.path, array[pair_addy.token0,pair_addy.token1])OR contains_sequence(r2.path, array[pair_addy.token1,pair_addy.token0]))), final as(SELECTconcat(COALESCE(tk201.symbol, first_token), '/', COALESCE(tk202.symbol, last_token)) as path_symbol, count(*) as path_count, arbitrary(tx_hash) as example_hash -- arbitrary gives us a random call_tx_hash that fits our criteria.From path_indirect as indirectLeft join tokens.erc20 as tk201 ON tk201.contract_address = indirect.first_token AND tk201.blockchain = 'ethereum'LEft join tokens.erc20 as tk202 ON tk202.contract_address = indirect.last_token AND tk202.blockchain = 'ethereum'Group By 1Order By 2 DESC)SELECTfinal.path_symbol, final.path_count, concat('<a href="', chain_explorer.explorer, '/tx/', final.example_hash, '" target = "blank">' -- composing the link, final.example_hash -- label for the link