@@ -50,12 +50,12 @@ func NewPoolTracker(
5050 }, nil
5151}
5252
53- func (d * PoolTracker ) GetNewPoolState (
53+ func (t * PoolTracker ) GetNewPoolState (
5454 ctx context.Context ,
5555 p entity.Pool ,
5656 param sourcePool.GetNewPoolStateParams ,
5757) (entity.Pool , error ) {
58- logger .Infof ("[%s] Start getting new state of pool: %v" , d .config .DexID , p .Address )
58+ logger .Infof ("[%s] Start getting new state of pool: %v" , t .config .DexID , p .Address )
5959
6060 var (
6161 rpcData * FetchRPCResult
@@ -65,7 +65,7 @@ func (d *PoolTracker) GetNewPoolState(
6565 g := pool .New ().WithContext (ctx )
6666 g .Go (func (context.Context ) error {
6767 var err error
68- rpcData , err = d .FetchRPCData (ctx , & p , 0 )
68+ rpcData , err = t .FetchRPCData (ctx , & p , 0 )
6969 if err != nil {
7070 logger .WithFields (logger.Fields {
7171 "poolAddress" : p .Address ,
@@ -77,8 +77,8 @@ func (d *PoolTracker) GetNewPoolState(
7777 })
7878 g .Go (func (context.Context ) error {
7979 var err error
80- if d .config .AlwaysUseTickLens {
81- poolTicks , err = ticklens .GetPoolTicksFromSC (ctx , d .ethrpcClient , d .config .TickLensAddress , p , nil )
80+ if t .config .AlwaysUseTickLens {
81+ poolTicks , err = ticklens .GetPoolTicksFromSC (ctx , t .ethrpcClient , t .config .TickLensAddress , p , nil )
8282 if err != nil {
8383 logger .WithFields (logger.Fields {
8484 "error" : err ,
@@ -87,7 +87,7 @@ func (d *PoolTracker) GetNewPoolState(
8787 return err
8888 }
8989
90- poolTicks , err = d .getPoolTicks (ctx , p .Address )
90+ poolTicks , err = t .getPoolTicks (ctx , p .Address )
9191 if err != nil {
9292 logger .WithFields (logger.Fields {
9393 "poolAddress" : p .Address ,
@@ -145,12 +145,12 @@ func (d *PoolTracker) GetNewPoolState(
145145 rpcData .Reserve1 .String (),
146146 }
147147
148- logger .Infof ("[%s] Finish updating state of pool: %v" , d .config .DexID , p .Address )
148+ logger .Infof ("[%s] Finish updating state of pool: %v" , t .config .DexID , p .Address )
149149
150150 return p , nil
151151}
152152
153- func (d * PoolTracker ) FetchRPCData (ctx context.Context , p * entity.Pool , blockNumber uint64 ) (* FetchRPCResult , error ) {
153+ func (t * PoolTracker ) FetchRPCData (ctx context.Context , p * entity.Pool , blockNumber uint64 ) (* FetchRPCResult , error ) {
154154 var (
155155 liquidity * big.Int
156156 slot0 Slot0
@@ -160,15 +160,15 @@ func (d *PoolTracker) FetchRPCData(ctx context.Context, p *entity.Pool, blockNum
160160 reserve1 = zeroBI
161161 )
162162
163- rpcRequest := d .ethrpcClient .NewRequest ()
163+ rpcRequest := t .ethrpcClient .NewRequest ()
164164 rpcRequest .SetContext (ctx )
165165 if blockNumber > 0 {
166166 var blockNumberBI big.Int
167167 blockNumberBI .SetUint64 (blockNumber )
168168 rpcRequest .SetBlockNumber (& blockNumberBI )
169169 }
170170
171- if d .config .IsPoolV3 {
171+ if t .config .IsPoolV3 {
172172 rpcRequest .AddCall (& ethrpc.Call {
173173 ABI : poolV3ABI ,
174174 Target : p .Address ,
@@ -236,8 +236,8 @@ func (d *PoolTracker) FetchRPCData(ctx context.Context, p *entity.Pool, blockNum
236236 }, err
237237}
238238
239- func (d * PoolTracker ) getPoolTicks (ctx context.Context , poolAddress string ) ([]ticklens.TickResp , error ) {
240- allowSubgraphError := d .config .IsAllowSubgraphError ()
239+ func (t * PoolTracker ) getPoolTicks (ctx context.Context , poolAddress string ) ([]ticklens.TickResp , error ) {
240+ allowSubgraphError := t .config .IsAllowSubgraphError ()
241241 lastTickIdx := ""
242242 var ticks []ticklens.TickResp
243243
@@ -249,7 +249,7 @@ func (d *PoolTracker) getPoolTicks(ctx context.Context, poolAddress string) ([]t
249249 Meta * valueobject.SubgraphMeta `json:"_meta"`
250250 }
251251
252- if err := d .graphqlClient .Run (ctx , req , & resp ); err != nil {
252+ if err := t .graphqlClient .Run (ctx , req , & resp ); err != nil {
253253 // Workaround at the moment to live with the error subgraph on Arbitrum
254254 if allowSubgraphError {
255255 if resp .Ticks == nil {
@@ -272,7 +272,7 @@ func (d *PoolTracker) getPoolTicks(ctx context.Context, poolAddress string) ([]t
272272 }
273273 }
274274
275- resp .Meta .CheckIsLagging (d .config .DexID , poolAddress )
275+ resp .Meta .CheckIsLagging (t .config .DexID , poolAddress )
276276
277277 if len (resp .Ticks ) == 0 {
278278 break
0 commit comments