@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.js +18 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/utils/query.ts +12 -7
- package/src/utils/util.ts +6 -1
package/package.json
CHANGED
package/src/utils/query.ts
CHANGED
|
@@ -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).
|
|
506
|
-
|
|
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([
|
|
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 (
|