feat(core): implement core MEV bot functionality with market scanning and Uniswap V3 pricing

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
Krypto Kajun
2025-09-14 10:16:29 -05:00
parent 5db7587923
commit c16182d80c
1364 changed files with 473970 additions and 1202 deletions

View File

@@ -1,5 +1,3 @@
package config
import (
@@ -140,10 +138,10 @@ func Load(filename string) (*Config, error) {
func expandEnvVars(s string) string {
// Pattern to match ${VAR} and $VAR
envVarPattern := regexp.MustCompile(`\$\{([^}]+)\}|\$([A-Za-z_][A-Za-z0-9_]*)`)
return envVarPattern.ReplaceAllStringFunc(s, func(match string) string {
var varName string
// Handle ${VAR} format
if strings.HasPrefix(match, "${") && strings.HasSuffix(match, "}") {
varName = match[2 : len(match)-1]
@@ -151,12 +149,12 @@ func expandEnvVars(s string) string {
// Handle $VAR format
varName = match[1:]
}
// Get environment variable value
if value := os.Getenv(varName); value != "" {
return value
}
// Return empty string if environment variable is not set
// This prevents invalid YAML when variables are missing
return ""
@@ -200,4 +198,4 @@ func (c *Config) OverrideWithEnv() {
c.Bot.ChannelBufferSize = val
}
}
}
}

View File

@@ -126,4 +126,4 @@ bot:
assert.Equal(t, "https://override.arbitrum.io/rpc", cfg.Arbitrum.RPCEndpoint)
assert.Equal(t, 20, cfg.Arbitrum.RateLimit.RequestsPerSecond)
assert.Equal(t, 20, cfg.Bot.MaxWorkers)
}
}