From 01fffa645b399e10c53206052992d985b51127c1 Mon Sep 17 00:00:00 2001 From: johnwhitton Date: Thu, 11 Sep 2025 08:21:16 -0700 Subject: [PATCH] Use sequentialSwaps for cyclical routes --- src/encoding/evm/tycho_encoders.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/encoding/evm/tycho_encoders.rs b/src/encoding/evm/tycho_encoders.rs index 2710d71..b6aaa02 100644 --- a/src/encoding/evm/tycho_encoders.rs +++ b/src/encoding/evm/tycho_encoders.rs @@ -103,7 +103,9 @@ impl TychoRouterEncoder { solution .swaps .iter() - .all(|swap| swap.split == 0.0)) + .all(|swap| swap.split == 0.0) && + !(solution.given_token == solution.checked_token && solution.swaps.len() > 2)) + // This is a special case for cyclical swaps { self.single_swap_strategy .encode_strategy(solution)?