style: format code with gofmt
This commit is contained in:
@@ -68,7 +68,7 @@ type ArbitrageDetectionEngine struct {
|
||||
// CRITICAL FIX: Backpressure for opportunity handlers
|
||||
// Prevents unbounded goroutine creation under high opportunity rate
|
||||
handlerSemaphore chan struct{} // Limits concurrent handler executions
|
||||
maxHandlers int // Maximum concurrent handler goroutines
|
||||
maxHandlers int // Maximum concurrent handler goroutines
|
||||
}
|
||||
|
||||
// DetectionConfig contains all configuration parameters for the arbitrage detection engine.
|
||||
@@ -159,8 +159,8 @@ func NewArbitrageDetectionEngine(
|
||||
isRunning: false,
|
||||
stopChan: make(chan struct{}),
|
||||
opportunityChan: make(chan *types.ArbitrageOpportunity, 1000), // Buffered channel
|
||||
maxHandlers: 10, // CRITICAL FIX: Limit to 10 concurrent handlers
|
||||
handlerSemaphore: make(chan struct{}, 10), // CRITICAL FIX: Backpressure semaphore
|
||||
maxHandlers: 10, // CRITICAL FIX: Limit to 10 concurrent handlers
|
||||
handlerSemaphore: make(chan struct{}, 10), // CRITICAL FIX: Backpressure semaphore
|
||||
}
|
||||
|
||||
// Set default configuration if not provided
|
||||
|
||||
@@ -96,7 +96,7 @@ func NewMultiHopScanner(logger *logger.Logger, client *ethclient.Client, poolDis
|
||||
cacheExpiry: time.Second * 30, // Cache for 30 seconds only - REDUCED for fresh opportunities
|
||||
reserveCache: reserveCache, // ADDED: Reserve cache
|
||||
tokenGraph: NewTokenGraph(),
|
||||
poolDiscovery: poolDiscovery, // CRITICAL FIX: Store pool discovery for loading cached pools
|
||||
poolDiscovery: poolDiscovery, // CRITICAL FIX: Store pool discovery for loading cached pools
|
||||
pools: make(map[common.Address]*PoolInfo),
|
||||
}
|
||||
|
||||
|
||||
@@ -80,11 +80,11 @@ type ArbitrageDatabase interface {
|
||||
// ArbitrageService is a sophisticated arbitrage service with comprehensive MEV detection
|
||||
// Now integrated with the complete MEV bot architecture
|
||||
type ArbitrageService struct {
|
||||
client *ethclient.Client
|
||||
logger *logger.Logger
|
||||
config *config.ArbitrageConfig // Legacy arbitrage config
|
||||
fullConfig *config.Config // Full config for L2 optimizations
|
||||
keyManager *security.KeyManager
|
||||
client *ethclient.Client
|
||||
logger *logger.Logger
|
||||
config *config.ArbitrageConfig // Legacy arbitrage config
|
||||
fullConfig *config.Config // Full config for L2 optimizations
|
||||
keyManager *security.KeyManager
|
||||
|
||||
// Core components (legacy)
|
||||
multiHopScanner *MultiHopScanner
|
||||
|
||||
Reference in New Issue
Block a user