- Added comprehensive bounds checking to prevent buffer overruns in multicall parsing - Implemented graduated validation system (Strict/Moderate/Permissive) to reduce false positives - Added LRU caching system for address validation with 10-minute TTL - Enhanced ABI decoder with missing Universal Router and Arbitrum-specific DEX signatures - Fixed duplicate function declarations and import conflicts across multiple files - Added error recovery mechanisms with multiple fallback strategies - Updated tests to handle new validation behavior for suspicious addresses - Fixed parser test expectations for improved validation system - Applied gofmt formatting fixes to ensure code style compliance - Fixed mutex copying issues in monitoring package by introducing MetricsSnapshot - Resolved critical security vulnerabilities in heuristic address extraction - Progress: Updated TODO audit from 10% to 35% complete 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.5 KiB
Go
52 lines
1.5 KiB
Go
package arbitrage
|
|
|
|
import (
|
|
"math/big"
|
|
"time"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"github.com/fraktal/mev-beta/pkg/math"
|
|
"github.com/fraktal/mev-beta/pkg/mev"
|
|
"github.com/fraktal/mev-beta/pkg/types"
|
|
)
|
|
|
|
// ExecutionResult represents the result of an arbitrage execution
|
|
type ExecutionResult struct {
|
|
TransactionHash common.Hash
|
|
GasUsed uint64
|
|
GasPrice *big.Int
|
|
GasCost *math.UniversalDecimal // Changed to UniversalDecimal for consistency with other components
|
|
ProfitRealized *big.Int
|
|
Success bool
|
|
Error error
|
|
ExecutionTime time.Duration
|
|
Path *ArbitragePath
|
|
ErrorMessage string // Added for compatibility
|
|
Status string // Added for compatibility
|
|
}
|
|
|
|
// ExecutionTask represents a task for execution
|
|
type ExecutionTask struct {
|
|
Opportunity *types.ArbitrageOpportunity
|
|
Priority int
|
|
Deadline time.Time
|
|
SubmissionTime time.Time // Added for tracking when the task was submitted
|
|
CompetitionAnalysis *mev.CompetitionData // Changed to match what the analyzer returns
|
|
ResultChan chan *ExecutionResult // Channel to send execution result back
|
|
}
|
|
|
|
// DetectionParams represents parameters for arbitrage opportunity detection
|
|
type DetectionParams struct {
|
|
TokenA common.Address
|
|
TokenB common.Address
|
|
MinProfit *big.Int
|
|
MaxSlippage float64
|
|
}
|
|
|
|
// TokenPair represents a trading pair
|
|
type TokenPair struct {
|
|
TokenA common.Address
|
|
TokenB common.Address
|
|
}
|