Skip to content

Commit

Permalink
Subtract average from target instead of target from average
Browse files Browse the repository at this point in the history
  • Loading branch information
edmulraney committed Nov 8, 2022
1 parent f195361 commit e17f243
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/dev-frontend/src/components/Bonds/context/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,6 @@ const getProtocolInfo = async (
isMainnet: boolean
): Promise<ProtocolInfo> => {
const bLusdSupply = decimalify(await bLusdToken.totalSupply());
// const marketPrice = Decimal.from(1.1);
const marketPrice = isMainnet
? await getBlusdAmmPriceMainnet(bLusdAmm)
: await getBlusdAmmPrice(bLusdAmm);
Expand Down
4 changes: 2 additions & 2 deletions packages/dev-frontend/src/components/Bonds/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ const getDaysUntilControllerStartsAdjusting = (
averageBondAgeInSeconds: Decimal,
targetBondAgeInSeconds: Decimal
): Decimal => {
const secondsUntil = averageBondAgeInSeconds.gt(targetBondAgeInSeconds)
? averageBondAgeInSeconds.sub(targetBondAgeInSeconds)
const secondsUntil = targetBondAgeInSeconds.gt(averageBondAgeInSeconds)
? targetBondAgeInSeconds.sub(averageBondAgeInSeconds)
: Decimal.ZERO;
const daysUntil = secondsToDays(parseFloat(secondsUntil.toString()));
return Decimal.from(daysUntil);
Expand Down

0 comments on commit e17f243

Please sign in to comment.