Skip to content

Commit

Permalink
Merge pull request #456 from galacticcouncil/master
Browse files Browse the repository at this point in the history
master->rococo
  • Loading branch information
vkulinich-cl authored Jan 25, 2024
2 parents 5cfe3b8 + e8bd048 commit 49b8c0d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/sections/pools/farm/detail/PoolFarmDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ export const PoolFarmDetail = (props: {
<Text fw={700}>{asset.data?.symbol}</Text>
</div>
<Text fs={16} lh={28} fw={600} color="primary200">
{t("value.APR.range", {
from: props.farm.minApr,
to: props.farm.apr,
})}
{props.farm.minApr.isEqualTo(props.farm.apr)
? t("value.APR", { apr: props.farm.apr })
: t("value.APR.range", {
from: props.farm.minApr,
to: props.farm.apr,
})}
</Text>
</div>
<div sx={{ flex: "column" }}>
Expand Down
4 changes: 3 additions & 1 deletion src/sections/pools/pool/incentives/row/PoolIncentivesRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export const PoolIncentivesRow = ({ assetId, apr, minApr }: Props) => {
{asset.data?.symbol}
</Text>
<Text fw={500} color="primary200" sx={{ ml: "auto" }}>
{t("value.APR.range", { from: minApr, to: apr })}
{minApr.isEqualTo(apr)
? t("value.APR", { apr })
: t("value.APR.range", { from: minApr, to: apr })}
</Text>
</SContainer>
)
Expand Down
4 changes: 2 additions & 2 deletions src/utils/farms/apr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useBestNumber } from "api/chain"
import { useFarms } from "api/farms"
import BigNumber from "bignumber.js"
import { secondsInYear } from "date-fns"
import { BLOCK_TIME, BN_1, BN_QUINTILL } from "utils/constants"
import { BLOCK_TIME, BN_0, BN_1, BN_QUINTILL } from "utils/constants"
import { useQueryReduce } from "utils/helpers"

export type AprFarm = NonNullable<
Expand Down Expand Up @@ -71,7 +71,7 @@ export const useAPR = (poolId: AccountId32 | string) => {
// all of the APR calculations are using only half of the position -
// this is correct in terms of inputs but for the user,
// they are not depositing only half of the position, they are depositing 2 assets
apr = apr.div(2)
apr = globalFarm.id.toString() === '5'? BN_0: apr.div(2)
const minApr = apr.times(loyaltyFactor)

// max distribution of rewards
Expand Down

0 comments on commit 49b8c0d

Please sign in to comment.