Files
mev-beta/pkg/interfaces/pool_cache.go
Administrator e02ded0a6a 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>
2025-11-10 09:59:37 +01:00

16 lines
464 B
Go

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
}