fix: correct Protocol and PoolType enum mappings

- 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 <noreply@anthropic.com>
This commit is contained in:
Administrator
2025-11-10 10:09:08 +01:00
parent e79e0d960d
commit 9935246022

View File

@@ -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
}
}