From 273fc340356e3c0759e29d63c0ca43d5613f359f Mon Sep 17 00:00:00 2001 From: vkulinich Date: Wed, 11 Dec 2024 11:18:19 +0100 Subject: [PATCH] Adjust APR --- src/api/farms.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/farms.ts b/src/api/farms.ts index 061e264cb..006984c59 100644 --- a/src/api/farms.ts +++ b/src/api/farms.ts @@ -205,6 +205,7 @@ const getFarmsData = yieldFarm, }, price.oraclePrice ?? globalFarm.priceAdjustment.toBigNumber(), + isXyk, balance.freeBalance, ) @@ -416,6 +417,7 @@ function getFarmApr( yieldFarm: PalletLiquidityMiningYieldFarmData }, priceAdjustment: BigNumber, + isXyk: boolean, potBalance?: string, ) { const { globalFarm, yieldFarm } = farm @@ -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