Skip to content

Commit

Permalink
fix: Account for deposit sent before DAI rate model was uploaded (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaspai authored May 23, 2022
1 parent f0f36d0 commit b14211e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/clients/ConfigStoreClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export class AcrossConfigStoreClient {
l1Token: string
): Promise<{ realizedLpFeePct: BigNumber; quoteBlock: number }> {
let quoteBlock = (await this.blockFinder.getBlockForTimestamp(deposit.quoteTimestamp)).number;

// There is one deposit on optimism for DAI that is right before the DAI rate model was added.
if (quoteBlock === 14830339) quoteBlock = 14830390;

const rateModel = this.getRateModelForBlockNumber(l1Token, quoteBlock);

// There is one deposit on optimism that is right at the margin of when liquidity was first added.
Expand Down

0 comments on commit b14211e

Please sign in to comment.