diff --git a/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol b/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol index 966abbd9b..efc5b05b0 100644 --- a/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol +++ b/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol @@ -339,6 +339,8 @@ library LibUbiquityPool { "Dollar price too low" ); + // update collateral price + updateChainLinkCollateralPrice(collateralIndex); // get amount of collateral for incoming Dollars collateralNeeded = getDollarInCollateral(collateralIndex, dollarAmount); @@ -413,6 +415,10 @@ library LibUbiquityPool { ) ) .div(UBIQUITY_POOL_PRICE_PRECISION); + + //update collateral price + updateChainLinkCollateralPrice(collateralIndex); + collateralOut = getDollarInCollateral(collateralIndex, dollarAfterFee); // checks