From 2e8dae0dd9a80e372ce23344f2c8d9d8535025b2 Mon Sep 17 00:00:00 2001 From: 0xddong Date: Wed, 3 Jul 2024 18:23:27 -0700 Subject: [PATCH] fix getCumulativeOfferData --- src/TermAuctionList.sol | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/TermAuctionList.sol b/src/TermAuctionList.sol index 3ac4a7bb..4955ab91 100644 --- a/src/TermAuctionList.sol +++ b/src/TermAuctionList.sol @@ -195,18 +195,12 @@ library TermAuctionList { /// @dev offer processed, but auctionClosed not yet called and auction is new so repoToken not on List and wont be picked up /// checking repoTokenAuctionRates to make sure we are not double counting on re-openings if (offer.termAuction.auctionCompleted() && repoTokenListData.auctionRates[offer.repoToken] == 0) { - // set offerAmount to pending offer amount - uint256 repoTokenAmountInBaseAssetPrecision = RepoTokenUtils.getNormalizedRepoTokenAmount( + // use normalized repo token amount if repo token is not in the list + offerAmount = RepoTokenUtils.getNormalizedRepoTokenAmount( offer.repoToken, ITermRepoToken(offer.repoToken).balanceOf(address(this)), purchaseTokenPrecision ); - offerAmount = RepoTokenUtils.calculatePresentValue( - repoTokenAmountInBaseAssetPrecision, - purchaseTokenPrecision, - RepoTokenList.getRepoTokenMaturity(offer.repoToken), - RepoTokenList.getAuctionRate(termController, ITermRepoToken(offer.repoToken)) - ); } }