Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
feat(farms): Re-label APY to APR since we calculate non-compounding v…
Browse files Browse the repository at this point in the history
…alues here
  • Loading branch information
immasandwich committed Jun 17, 2022
1 parent 85d550e commit 39bc100
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -105,7 +105,6 @@ type MasterChefContractPositionHelperParams<T> = {
resolveRewardRate?: MasterChefRewardRateStrategy<T>;
resolveLiquidity?: MasterChefLiquidityStrategy<T>;
resolveLabel?: MasterChefLabelStrategy;
resolveReturnOnInvestmentLabel?: () => string;
};

export type MasterChefContractPositionDataProps = {
@@ -146,7 +145,6 @@ export class MasterChefContractPositionHelper {
.balanceOf(address),
resolveAddress = async ({ contract }) => (contract as unknown as Contract).address,
resolveLabel = ({ stakedToken }) => `Staked ${getLabelFromToken(stakedToken)}`,
resolveReturnOnInvestmentLabel = () => 'APY',
}: MasterChefContractPositionHelperParams<T>): Promise<ContractPosition<MasterChefContractPositionDataProps>[]> {
const provider = this.appToolkit.getNetworkProvider(network);
const multicall = this.appToolkit.getMulticall(network);
@@ -284,7 +282,7 @@ export class MasterChefContractPositionHelper {
const secondaryLabel = buildDollarDisplayItem(stakedToken.price);
const images = getImagesFromToken(stakedToken);
const statsItems = [
{ label: resolveReturnOnInvestmentLabel(), value: buildPercentageDisplayItem(yearlyROI) },
{ label: 'APR', value: buildPercentageDisplayItem(yearlyROI) },
{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) },
];
const displayProps = {
Original file line number Diff line number Diff line change
@@ -203,7 +203,7 @@ export class SingleStakingFarmContractPositionHelper {
const secondaryLabel = buildDollarDisplayItem(stakedToken.price);
const images = [getTokenImg(stakedToken.address, network)];
const statsItems = [
{ label: 'APY', value: buildPercentageDisplayItem(rois.yearlyROI * 100) },
{ label: 'APR', value: buildPercentageDisplayItem(rois.yearlyROI * 100) },
{ label: 'Liquidity', value: buildDollarDisplayItem(liquidity) },
];
const displayProps = { label, secondaryLabel, images, statsItems };

0 comments on commit 39bc100

Please sign in to comment.