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:
@@ -62,31 +62,38 @@ func parseProtocol(protocol string) arbcommon.Protocol {
|
|||||||
return arbcommon.ProtocolUniswapV2
|
return arbcommon.ProtocolUniswapV2
|
||||||
case "uniswap-v3":
|
case "uniswap-v3":
|
||||||
return arbcommon.ProtocolUniswapV3
|
return arbcommon.ProtocolUniswapV3
|
||||||
case "sushiswap":
|
case "sushiswap", "sushiswap-v2":
|
||||||
return arbcommon.ProtocolSushiSwap
|
return arbcommon.ProtocolSushiSwapV2
|
||||||
case "camelot":
|
case "sushiswap-v3":
|
||||||
return arbcommon.ProtocolCamelot
|
return arbcommon.ProtocolSushiSwapV3
|
||||||
|
case "camelot", "camelot-v2":
|
||||||
|
return arbcommon.ProtocolCamelotV2
|
||||||
|
case "camelot-v3":
|
||||||
|
return arbcommon.ProtocolCamelotV3
|
||||||
case "curve":
|
case "curve":
|
||||||
return arbcommon.ProtocolCurve
|
return arbcommon.ProtocolCurve
|
||||||
case "balancer":
|
case "balancer", "balancer-v2":
|
||||||
return arbcommon.ProtocolBalancer
|
return arbcommon.ProtocolBalancerV2
|
||||||
|
case "balancer-v3":
|
||||||
|
return arbcommon.ProtocolBalancerV3
|
||||||
default:
|
default:
|
||||||
return arbcommon.ProtocolUnknown
|
// Default to UniswapV2 for unknown protocols
|
||||||
|
return arbcommon.ProtocolUniswapV2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// parsePoolType converts protocol string to PoolType enum
|
// parsePoolType converts protocol string to PoolType enum
|
||||||
func parsePoolType(protocol string) arbcommon.PoolType {
|
func parsePoolType(protocol string) arbcommon.PoolType {
|
||||||
switch protocol {
|
switch protocol {
|
||||||
case "uniswap-v2", "sushiswap", "camelot":
|
case "uniswap-v2", "sushiswap", "sushiswap-v2", "camelot", "camelot-v2":
|
||||||
return arbcommon.PoolTypeV2
|
return arbcommon.PoolTypeConstantProduct
|
||||||
case "uniswap-v3":
|
case "uniswap-v3", "sushiswap-v3", "camelot-v3":
|
||||||
return arbcommon.PoolTypeV3
|
return arbcommon.PoolTypeConcentrated
|
||||||
case "curve":
|
case "curve":
|
||||||
return arbcommon.PoolTypeStableSwap
|
return arbcommon.PoolTypeStableSwap
|
||||||
case "balancer":
|
case "balancer", "balancer-v2", "balancer-v3":
|
||||||
return arbcommon.PoolTypeWeighted
|
return arbcommon.PoolTypeWeighted
|
||||||
default:
|
default:
|
||||||
return arbcommon.PoolTypeUnknown
|
return arbcommon.PoolTypeConstantProduct
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user