-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve(dataworker): Remove transferThreshold
#937
Changes from all commits
158920d
6d5e600
f12e3c7
af0b889
8a11383
0c769bb
819a96d
2871b09
c4c9a71
90cb0d1
2a488fe
d56c7c2
a5b8324
3ea5360
5dccd30
c6b4f99
b95a732
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { clients } from "@across-protocol/sdk-v2"; | ||
import { Contract } from "ethers"; | ||
import { BigNumber, Contract } from "ethers"; | ||
import winston from "winston"; | ||
import { MakeOptional, EventSearchConfig } from "../utils"; | ||
import { IGNORED_HUB_EXECUTED_BUNDLES, IGNORED_HUB_PROPOSED_BUNDLES } from "../common"; | ||
import { DepositWithBlock } from "../interfaces"; | ||
|
||
export class HubPoolClient extends clients.HubPoolClient { | ||
constructor( | ||
|
@@ -18,4 +19,20 @@ export class HubPoolClient extends clients.HubPoolClient { | |
ignoredHubProposedBundles: IGNORED_HUB_PROPOSED_BUNDLES, | ||
}); | ||
} | ||
|
||
async computeRealizedLpFeePct( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I think this code from a different branch accidentally got included here. These commits should be removed (or just merge master) before merging. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope, that other PR was merged into this branch! |
||
deposit: Pick< | ||
DepositWithBlock, | ||
"quoteTimestamp" | "amount" | "destinationChainId" | "originChainId" | "blockNumber" | ||
>, | ||
l1Token: string | ||
): Promise<{ realizedLpFeePct: BigNumber | undefined; quoteBlock: number }> { | ||
if (deposit.quoteTimestamp > this.currentTime) { | ||
throw new Error( | ||
`Cannot compute lp fee percent for quote timestamp ${deposit.quoteTimestamp} in the future. Current time: ${this.currentTime}.` | ||
); | ||
} | ||
|
||
return await super.computeRealizedLpFeePct(deposit, l1Token); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
import { clients } from "@across-protocol/sdk-v2"; | ||
import { FundsDepositedEvent } from "../interfaces"; | ||
import { isDefined } from "../utils/TypeGuards"; | ||
|
||
export class SpokePoolClient extends clients.SpokePoolClient {} | ||
export class SpokePoolClient extends clients.SpokePoolClient { | ||
_isEarlyDeposit(depositEvent: FundsDepositedEvent, currentTime: number): boolean { | ||
const hubCurrentTime = this.hubPoolClient?.currentTime; | ||
if (!isDefined(hubCurrentTime)) { | ||
throw new Error("HubPoolClient's currentTime is not defined"); | ||
} | ||
return depositEvent.args.quoteTimestamp > currentTime || depositEvent.args.quoteTimestamp > hubCurrentTime; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did we get this far behind...? Can you just double check the changes that get pulled in here (considering the number of bumps)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe 0.15.24 was the last release before 0.16 and that's because https://github.com/across-protocol/sdk-v2/releases/tag/v0.16.0 introduced the removal of the
transferThreshold
variable!This PR has been sitting for a while haha