From b14211e20c9661ef4068963cc3e63fc65a938c1e Mon Sep 17 00:00:00 2001 From: nicholaspai <9457025+nicholaspai@users.noreply.github.com> Date: Mon, 23 May 2022 12:31:08 -0400 Subject: [PATCH] fix: Account for deposit sent before DAI rate model was uploaded (#59) --- src/clients/ConfigStoreClient.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/clients/ConfigStoreClient.ts b/src/clients/ConfigStoreClient.ts index be9578a11..ee6ad9af9 100644 --- a/src/clients/ConfigStoreClient.ts +++ b/src/clients/ConfigStoreClient.ts @@ -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.