@scallop-io/sui-scallop-sdk 0.46.0 → 0.46.2
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.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/queries/vescaQuery.ts +1 -1
- package/src/utils/query.ts +9 -4
package/package.json
CHANGED
package/src/utils/query.ts
CHANGED
|
@@ -255,9 +255,11 @@ export const calculateSpoolData = (
|
|
|
255
255
|
const pointPerSec = BigNumber(parsedSpoolData.pointPerPeriod).dividedBy(
|
|
256
256
|
parsedSpoolData.period
|
|
257
257
|
);
|
|
258
|
-
const remainingPeriod =
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
const remainingPeriod = pointPerSec.gt(0)
|
|
259
|
+
? BigNumber(parsedSpoolData.maxPoint)
|
|
260
|
+
.minus(parsedSpoolData.distributedPoint)
|
|
261
|
+
.dividedBy(pointPerSec)
|
|
262
|
+
: BigNumber(0);
|
|
261
263
|
const startDate = parsedSpoolData.createdAt;
|
|
262
264
|
const endDate = remainingPeriod
|
|
263
265
|
.plus(parsedSpoolData.lastUpdate)
|
|
@@ -368,7 +370,10 @@ export const calculateSpoolRewardPoolData = (
|
|
|
368
370
|
? rewardValueForYear.dividedBy(calculatedSpoolData.stakedValue).toNumber()
|
|
369
371
|
: Infinity;
|
|
370
372
|
|
|
371
|
-
if (
|
|
373
|
+
if (
|
|
374
|
+
parsedSpoolData.maxPoint <= parsedSpoolData.distributedPoint ||
|
|
375
|
+
parsedSpoolData.pointPerPeriod === 0
|
|
376
|
+
) {
|
|
372
377
|
rewardRate = Infinity;
|
|
373
378
|
}
|
|
374
379
|
|