@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/dist/index.mjs CHANGED
@@ -1135,12 +1135,20 @@ var calculateBorrowIncentivePoolPointData = (pasredBorrowIncentinvePoolData, par
1135
1135
  );
1136
1136
  const weightedStakedValue = weightedStakedCoin.multipliedBy(poolCoinPrice);
1137
1137
  const rateYearFactor = 365 * 24 * 60 * 60;
1138
- const rewardPerSec = BigNumber(distributedPointPerSec).dividedBy(
1139
- parsedBorrowIncentivePoolPointData.period
1138
+ const rewardPerSec = BigNumber(distributedPointPerSec).shiftedBy(
1139
+ -1 * rewardCoinDecimal
1140
1140
  );
1141
- const rewardValueForYear = BigNumber(rewardPerSec).shiftedBy(-1 * rewardCoinDecimal).multipliedBy(rateYearFactor).multipliedBy(rewardCoinPrice);
1141
+ const rewardValueForYear = BigNumber(rewardPerSec).multipliedBy(rateYearFactor).multipliedBy(rewardCoinPrice);
1142
1142
  const weightScale = BigNumber("1000000000000");
1143
- const rewardRate = rewardValueForYear.dividedBy(weightedStakedValue).multipliedBy(parsedBorrowIncentivePoolPointData.baseWeight).dividedBy(weightScale).isFinite() ? rewardValueForYear.dividedBy(weightedStakedValue).multipliedBy(parsedBorrowIncentivePoolPointData.baseWeight).dividedBy(weightScale).toNumber() : Infinity;
1143
+ const rewardRate = rewardValueForYear.multipliedBy(
1144
+ BigNumber(parsedBorrowIncentivePoolPointData.baseWeight).dividedBy(
1145
+ weightScale
1146
+ )
1147
+ ).dividedBy(weightedStakedValue).isFinite() ? rewardValueForYear.multipliedBy(
1148
+ BigNumber(parsedBorrowIncentivePoolPointData.baseWeight).dividedBy(
1149
+ weightScale
1150
+ )
1151
+ ).dividedBy(weightedStakedValue).toNumber() : Infinity;
1144
1152
  return {
1145
1153
  distributedPointPerSec: distributedPointPerSec.toNumber(),
1146
1154
  accumulatedPoints: accumulatedPoints.toNumber(),
@@ -1233,7 +1241,12 @@ var parseAssetSymbol = (coinName) => {
1233
1241
  };
1234
1242
  var parseDataFromPythPriceFeed = (feed, address) => {
1235
1243
  const assetCoinNames = [
1236
- .../* @__PURE__ */ new Set([...SUPPORT_POOLS, ...SUPPORT_COLLATERALS])
1244
+ .../* @__PURE__ */ new Set([
1245
+ ...SUPPORT_POOLS,
1246
+ ...SUPPORT_COLLATERALS,
1247
+ ...SUPPORT_SPOOLS_REWARDS,
1248
+ ...SUPPORT_BORROW_INCENTIVE_REWARDS
1249
+ ])
1237
1250
  ];
1238
1251
  const assetCoinName = assetCoinNames.find((assetCoinName2) => {
1239
1252
  return address.get(`core.coins.${assetCoinName2}.oracle.pyth.feed`) === feed.id;