Skip to content

Commit

Permalink
univ3 to support always using ticklens instead of subgraph (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
it4rb authored Oct 28, 2024
1 parent 670c8e3 commit abe7e88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/source/uniswapv3/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ type Config struct {
PreGenesisPoolPath string `json:"preGenesisPoolPath"`
AllowSubgraphError bool `json:"allowSubgraphError"`
preGenesisPoolIDs []string

AlwaysUseTickLens bool // instead of fetching from subgraph
}

func (c *Config) IsAllowSubgraphError() bool {
Expand Down
2 changes: 1 addition & 1 deletion pkg/source/uniswapv3/pool_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (d *PoolTracker) GetNewPoolState(
// Link to issue: https://www.notion.so/kybernetwork/Aggregator-1-20-defect-1caec6062f9d4da0918fc3443e6e1963#0810d1462cc14f0a9465f935c9e641fe
// TLDR: Optimism has some pre-genesis Uniswap V3 pool. Subgraph does not have data for these pools
// So we have to fetch ticks data from the TickLens smart contract (which is slower).
if lo.Contains[string](d.config.preGenesisPoolIDs, p.Address) {
if d.config.AlwaysUseTickLens || lo.Contains[string](d.config.preGenesisPoolIDs, p.Address) {
poolTicks, err = d.getPoolTicksFromSC(ctx, p)
if err != nil {
l.WithFields(logger.Fields{
Expand Down

0 comments on commit abe7e88

Please sign in to comment.