Skip to content

Commit

Permalink
Peter/fix loans incentive apr computation (#1256)
Browse files Browse the repository at this point in the history
* chore: update monetary to latest 0.7.3

* fix: convert incentives apr computation to percentage

* fix: change loans incentives annualized return to have label APR
  • Loading branch information
peterslany authored Jun 9, 2023
1 parent 4bf3e13 commit 6f2972d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/LoanApyTooltip/BreakdownGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const BreakdownGroup = ({ apy, rewardsApy, ticker, rewardsTicker, isBorrow }: Br
</StyledApyTooltipGroup>
{!!rewardsApy && (
<StyledApyTooltipGroup gap='spacing1' wrap>
<Dd color='tertiary'>Rewards APY {rewardsTicker}:</Dd>
<Dd color='tertiary'>Rewards APR {rewardsTicker}:</Dd>
<Dt color='primary'>{getApyLabel(rewardsApy)}</Dt>
</StyledApyTooltipGroup>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const RewardsGroup = ({ isBorrow, apy, assetCurrency, rewards, prices }: Rewards
return (
<>
<DlGroup justifyContent='space-between'>
<Dt>Rewards APY {rewards.currency.ticker}</Dt>
<Dt>Rewards APR {rewards.currency.ticker}</Dt>
<Dd>{getApyLabel(subsidyRewardApy)}</Dd>
</DlGroup>
<DlGroup justifyContent='space-between'>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/helpers/loans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const getSubsidyRewardApy = (
}

const exchangeRate = rewardCurrencyPriceUSD / positionCurrencyPriceUSD;
const apy = reward.toBig().mul(exchangeRate);
const apy = reward.toBig().mul(exchangeRate).mul(100);

return apy;
};
Expand Down

2 comments on commit 6f2972d

@vercel
Copy link

@vercel vercel bot commented on 6f2972d Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 6f2972d Jun 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.