fix(types): add missing types and fix compilation errors - WIP

Fixed compilation errors in integration code:

Type System Fixes:
- Add types.Logger type alias (*slog.Logger)
- Add PoolInfo.LiquidityUSD field
- Add ProtocolSushiSwap and ProtocolCamelot constants
- Fix time.Now() call in arbiscan_validator.go

Pool Discovery Fixes:
- Change cache from *cache.PoolCache to cache.PoolCache (interface)
- Add context.Context parameters to cache.Add() and cache.Count() calls
- Fix protocol type from string to ProtocolType

Docker Fixes:
- Add .dockerignore to exclude test files and docs
- Add go mod tidy step in Dockerfile
- Add //go:build examples tag to example_usage.go

Still Remaining:
- Arbitrage package needs similar interface fixes
- SwapEvent.TokenIn/TokenOut field name issues
- More cache interface method calls need context

Progress: Parser and pool discovery packages now compile correctly.
Integration code (main.go, sequencer, pools) partially working.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Administrator
2025-11-10 19:30:00 +01:00
parent 8f2264fb4e
commit 9982573a8b
8 changed files with 83 additions and 10 deletions

8
pkg/types/logger.go Normal file
View File

@@ -0,0 +1,8 @@
package types
import (
"log/slog"
)
// Logger is an alias for structured logger
type Logger = *slog.Logger

View File

@@ -25,6 +25,7 @@ type PoolInfo struct {
Reserve0 *big.Int
Reserve1 *big.Int
Liquidity *big.Int
LiquidityUSD *big.Int // Total liquidity in USD (estimated)
// Fee information
Fee uint32 // Fee in basis points (e.g., 30 = 0.3%)

View File

@@ -20,6 +20,8 @@ const (
ProtocolBalancerV3 ProtocolType = "balancer-v3"
ProtocolKyberClassic ProtocolType = "kyber-classic"
ProtocolKyberElastic ProtocolType = "kyber-elastic"
ProtocolSushiSwap ProtocolType = "sushiswap"
ProtocolCamelot ProtocolType = "camelot"
ProtocolCamelotV2 ProtocolType = "camelot-v2"
ProtocolCamelotV3AlgebraV1 ProtocolType = "camelot-v3-algebra-v1"
ProtocolCamelotV3AlgebraV19 ProtocolType = "camelot-v3-algebra-v1.9"