Skip to content

Commit

Permalink
increase lookback
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai committed Mar 21, 2024
1 parent 571fd90 commit 84837db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dataworker/Dataworker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ export class Dataworker {
this.clients.hubPoolClient.getLpTokenInfoForL1Token(l1Token)?.lastLpFeeUpdate ?? 0;
if (
this.clients.hubPoolClient.currentTime === undefined ||
this.clients.hubPoolClient.currentTime - lastestFeesCompoundedTime <= 7200 // 2 hours
this.clients.hubPoolClient.currentTime - lastestFeesCompoundedTime <= 2 * 24 * 60 * 60 // 2 day
) {
this.logger.debug({
at: "Dataworker#_updateOldExchangeRates",
Expand Down
8 changes: 4 additions & 4 deletions test/Dataworker.executePoolRebalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ describe("Dataworker: Execute pool rebalances", async function () {
expect(multiCallerClient.transactionCount()).to.equal(0);
});
it("exits early if liquid reserves wouldn't increase for token post-update", async function () {
// Last update was at time 0, current time is at 10_000, so definitely past the update threshold
mockHubPoolClient.currentTime = 10_000;
// Last update was at time 0, current time is at 1_000_000, so definitely past the update threshold
mockHubPoolClient.currentTime = 1_000_000;
mockHubPoolClient.setLpTokenInfo(l1Token_1.address, 0);

// Hardcode multicall output such that it looks like liquid reserves stayed the same
Expand Down Expand Up @@ -417,8 +417,8 @@ describe("Dataworker: Execute pool rebalances", async function () {
expect(multiCallerClient.transactionCount()).to.equal(0);
});
it("submits update if liquid reserves would increase for token post-update and last update was old enough", async function () {
// Last update was at time 0, current time is at 10_000, so definitely past the update threshold
mockHubPoolClient.currentTime = 10_000;
// Last update was at time 0, current time is at 1_000_000, so definitely past the update threshold
mockHubPoolClient.currentTime = 1_000_000;
mockHubPoolClient.setLpTokenInfo(l1Token_1.address, 0);

// Hardcode multicall output such that it looks like liquid reserves increased
Expand Down

0 comments on commit 84837db

Please sign in to comment.