@scallop-io/sui-scallop-sdk 0.44.19 → 0.44.20

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.19",
3
+ "version": "0.44.20",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -502,25 +502,30 @@ export const calculateBorrowIncentivePoolPointData = (
502
502
 
503
503
  // Calculate the reward rate
504
504
  const rateYearFactor = 365 * 24 * 60 * 60;
505
- const rewardPerSec = BigNumber(distributedPointPerSec).dividedBy(
506
- parsedBorrowIncentivePoolPointData.period
505
+ const rewardPerSec = BigNumber(distributedPointPerSec).shiftedBy(
506
+ -1 * rewardCoinDecimal
507
507
  );
508
508
 
509
509
  const rewardValueForYear = BigNumber(rewardPerSec)
510
- .shiftedBy(-1 * rewardCoinDecimal)
511
510
  .multipliedBy(rateYearFactor)
512
511
  .multipliedBy(rewardCoinPrice);
513
512
 
514
513
  const weightScale = BigNumber('1000000000000');
515
514
  const rewardRate = rewardValueForYear
515
+ .multipliedBy(
516
+ BigNumber(parsedBorrowIncentivePoolPointData.baseWeight).dividedBy(
517
+ weightScale
518
+ )
519
+ )
516
520
  .dividedBy(weightedStakedValue)
517
- .multipliedBy(parsedBorrowIncentivePoolPointData.baseWeight)
518
- .dividedBy(weightScale)
519
521
  .isFinite()
520
522
  ? rewardValueForYear
523
+ .multipliedBy(
524
+ BigNumber(parsedBorrowIncentivePoolPointData.baseWeight).dividedBy(
525
+ weightScale
526
+ )
527
+ )
521
528
  .dividedBy(weightedStakedValue)
522
- .multipliedBy(parsedBorrowIncentivePoolPointData.baseWeight)
523
- .dividedBy(weightScale)
524
529
  .toNumber()
525
530
  : Infinity;
526
531
 
package/src/utils/util.ts CHANGED
@@ -55,7 +55,12 @@ export const parseDataFromPythPriceFeed = (
55
55
  address: ScallopAddress
56
56
  ) => {
57
57
  const assetCoinNames = [
58
- ...new Set([...SUPPORT_POOLS, ...SUPPORT_COLLATERALS]),
58
+ ...new Set([
59
+ ...SUPPORT_POOLS,
60
+ ...SUPPORT_COLLATERALS,
61
+ ...SUPPORT_SPOOLS_REWARDS,
62
+ ...SUPPORT_BORROW_INCENTIVE_REWARDS,
63
+ ]),
59
64
  ] as SupportAssetCoins[];
60
65
  const assetCoinName = assetCoinNames.find((assetCoinName) => {
61
66
  return (