fix: use pool cache to avoid zero addresses in Uniswap V3 parsing
- Added poolCache field to EventParser struct with PoolCache interface - Modified getPoolTokens() to check cache before returning zero addresses - Created PoolCache interface in pkg/interfaces for clean separation - Added debug logging to identify pools missing from cache - Documented long-term architecture improvements in PARSER_ARCHITECTURE_IMPROVEMENTS.md This fixes the critical issue where Uniswap V3 swap events would show zero addresses for tokens when transaction calldata was unavailable. The parser now falls back to the pool cache which contains previously discovered pool information. Benefits: - Eliminates zero address errors for known pools - Reduces unnecessary RPC calls - Provides visibility into which pools are missing from cache - Lays foundation for per-exchange parser architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
15
pkg/interfaces/pool_cache.go
Normal file
15
pkg/interfaces/pool_cache.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package interfaces
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
arbcommon "github.com/fraktal/mev-beta/pkg/arbitrum/common"
|
||||
)
|
||||
|
||||
// PoolCache provides access to cached pool information
|
||||
type PoolCache interface {
|
||||
// GetPool retrieves pool information from cache
|
||||
GetPool(address common.Address) *arbcommon.PoolInfo
|
||||
|
||||
// GetPoolsByTokenPair retrieves pools for a specific token pair
|
||||
GetPoolsByTokenPair(token0, token1 common.Address) []*arbcommon.PoolInfo
|
||||
}
|
||||
Reference in New Issue
Block a user