From 993524602278a62a28fb96444459e9633c85db0f Mon Sep 17 00:00:00 2001 From: Administrator Date: Mon, 10 Nov 2025 10:09:08 +0100 Subject: [PATCH] fix: correct Protocol and PoolType enum mappings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use ProtocolSushiSwapV2/V3 instead of ProtocolSushiSwap - Use ProtocolCamelotV2/V3 instead of ProtocolCamelot - Use ProtocolBalancerV2/V3 instead of ProtocolBalancer - Use PoolTypeConstantProduct instead of PoolTypeV2 - Use PoolTypeConcentrated instead of PoolTypeV3 - Add default fallbacks to prevent undefined enum usage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- pkg/pools/pool_cache_adapter.go | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/pkg/pools/pool_cache_adapter.go b/pkg/pools/pool_cache_adapter.go index 1a202b0..60f4484 100644 --- a/pkg/pools/pool_cache_adapter.go +++ b/pkg/pools/pool_cache_adapter.go @@ -62,31 +62,38 @@ func parseProtocol(protocol string) arbcommon.Protocol { return arbcommon.ProtocolUniswapV2 case "uniswap-v3": return arbcommon.ProtocolUniswapV3 - case "sushiswap": - return arbcommon.ProtocolSushiSwap - case "camelot": - return arbcommon.ProtocolCamelot + case "sushiswap", "sushiswap-v2": + return arbcommon.ProtocolSushiSwapV2 + case "sushiswap-v3": + return arbcommon.ProtocolSushiSwapV3 + case "camelot", "camelot-v2": + return arbcommon.ProtocolCamelotV2 + case "camelot-v3": + return arbcommon.ProtocolCamelotV3 case "curve": return arbcommon.ProtocolCurve - case "balancer": - return arbcommon.ProtocolBalancer + case "balancer", "balancer-v2": + return arbcommon.ProtocolBalancerV2 + case "balancer-v3": + return arbcommon.ProtocolBalancerV3 default: - return arbcommon.ProtocolUnknown + // Default to UniswapV2 for unknown protocols + return arbcommon.ProtocolUniswapV2 } } // parsePoolType converts protocol string to PoolType enum func parsePoolType(protocol string) arbcommon.PoolType { switch protocol { - case "uniswap-v2", "sushiswap", "camelot": - return arbcommon.PoolTypeV2 - case "uniswap-v3": - return arbcommon.PoolTypeV3 + case "uniswap-v2", "sushiswap", "sushiswap-v2", "camelot", "camelot-v2": + return arbcommon.PoolTypeConstantProduct + case "uniswap-v3", "sushiswap-v3", "camelot-v3": + return arbcommon.PoolTypeConcentrated case "curve": return arbcommon.PoolTypeStableSwap - case "balancer": + case "balancer", "balancer-v2", "balancer-v3": return arbcommon.PoolTypeWeighted default: - return arbcommon.PoolTypeUnknown + return arbcommon.PoolTypeConstantProduct } }