@scallop-io/sui-scallop-sdk 0.44.17 → 0.44.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "0.44.17",
3
+ "version": "0.44.18",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -359,12 +359,17 @@ export const calculateSpoolRewardPoolData = (
359
359
  .shiftedBy(-1 * rewardCoinDecimal)
360
360
  .multipliedBy(rateYearFactor)
361
361
  .multipliedBy(rewardCoinPrice);
362
- const rewardRate = rewardValueForYear
362
+
363
+ let rewardRate = rewardValueForYear
363
364
  .dividedBy(calculatedSpoolData.stakedValue)
364
365
  .isFinite()
365
366
  ? rewardValueForYear.dividedBy(calculatedSpoolData.stakedValue).toNumber()
366
367
  : Infinity;
367
368
 
369
+ if (parsedSpoolData.maxPoint === parsedSpoolData.distributedPoint) {
370
+ rewardRate = Infinity;
371
+ }
372
+
368
373
  return {
369
374
  rewardApr: rewardRate,
370
375
  totalRewardAmount: totalRewardAmount.toNumber(),