Skip to content

Commit

Permalink
Merge pull request #1952 from galacticcouncil/rococo
Browse files Browse the repository at this point in the history
Rococo => prod
  • Loading branch information
vkulinich-cl authored Dec 11, 2024
2 parents 4b3934e + 3cd8a7f commit 37052ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/farms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const getFarmsData =
yieldFarm,
},
price.oraclePrice ?? globalFarm.priceAdjustment.toBigNumber(),
isXyk,
balance.freeBalance,
)

Expand Down Expand Up @@ -416,6 +417,7 @@ function getFarmApr(
yieldFarm: PalletLiquidityMiningYieldFarmData
},
priceAdjustment: BigNumber,
isXyk: boolean,
potBalance?: string,
) {
const { globalFarm, yieldFarm } = farm
Expand Down Expand Up @@ -498,7 +500,7 @@ function getFarmApr(
const isDistributed = distributedRewards.div(potMaxRewards).gte(0.999)

// multiply by 100 since APR should be a percentage
apr = isDistributed ? BN_0 : apr.times(100)
apr = isDistributed ? BN_0 : apr.div(isXyk ? 2 : 1).times(100)

const minApr = loyaltyFactor ? apr.times(loyaltyFactor) : null

Expand Down

0 comments on commit 37052ba

Please sign in to comment.