Skip to content

Commit

Permalink
fix: Fix Farm APR card (pancakeswap#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChefKai authored Apr 7, 2021
1 parent d8291de commit f8f6cc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/views/Home/components/EarnAPYCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import useI18n from 'hooks/useI18n'
import BigNumber from 'bignumber.js'
import { getFarmApy } from 'utils/apy'
import { useFarms, usePriceCakeBusd, useGetApiPrices } from 'state/hooks'
import { getAddress } from '../../../utils/addressHelpers'

const StyledFarmStakingCard = styled(Card)`
margin-left: auto;
Expand All @@ -33,7 +34,7 @@ const EarnAPYCard = () => {
.filter((farm) => farm.pid !== 0 && farm.multiplier !== '0X')
.map((farm) => {
if (farm.lpTotalInQuoteToken && prices) {
const quoteTokenPriceUsd = prices[farm.quoteToken.symbol.toLowerCase()]
const quoteTokenPriceUsd = prices[getAddress(farm.quoteToken.address).toLowerCase()]
const totalLiquidity = new BigNumber(farm.lpTotalInQuoteToken).times(quoteTokenPriceUsd)
return getFarmApy(farm.poolWeight, cakePrice, totalLiquidity)
}
Expand Down

0 comments on commit f8f6cc5

Please sign in to comment.