Replaced hardcoded router map with externalized DEX configuration from
config/dex.yaml for flexibility and maintainability.
## Changes Made
### pkg/sequencer/decoder.go
- Added pkg/config import
- Added package-level dexConfig variable
- Created InitDEXConfig() function to load config from file
- Modified GetSwapProtocol() to use config.Routers map instead of hardcoded map
- Removed 12 hardcoded router addresses
- Config fallback: uses function selector matching if config not loaded
## Benefits
- Configuration external from code
- Easy to add new DEX routers without code changes
- Centralized router configuration in config/dex.yaml
- Backward compatible: falls back to selector matching
## Usage
```go
// At startup:
if err := sequencer.InitDEXConfig("config/dex.yaml"); err != nil {
log.Fatal(err)
}
```
## Testing
- ✅ Compilation verified: go build ./pkg/sequencer/...
- ✅ Backward compatible with existing code
- ✅ Config loading from config/dex.yaml
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
8.2 KiB
8.2 KiB