@scallop-io/sui-scallop-sdk 0.44.20 → 0.44.21
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 +8 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +1 -1
- package/dist/types/query/borrowIncentive.d.ts +1 -0
- package/package.json +1 -1
- package/src/constants/vesca.ts +3 -1
- package/src/queries/borrowIncentiveQuery.ts +1 -0
- package/src/queries/portfolioQuery.ts +10 -8
- package/src/types/query/borrowIncentive.ts +1 -0
- package/src/utils/query.ts +1 -1
|
@@ -20,6 +20,7 @@ export type BorrowIncentivePool = {
|
|
|
20
20
|
coinType: string;
|
|
21
21
|
coinDecimal: number;
|
|
22
22
|
coinPrice: number;
|
|
23
|
+
staked: number;
|
|
23
24
|
points: OptionalKeys<Record<SupportBorrowIncentiveRewardCoins, BorrowIncentivePoolPoints>>;
|
|
24
25
|
};
|
|
25
26
|
export type OriginBorrowIncentivePoolPointData = {
|
package/package.json
CHANGED
package/src/constants/vesca.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { IS_VE_SCA_TEST } from './common';
|
|
2
|
+
|
|
1
3
|
export const UNLOCK_ROUND_DURATION = 60 * 60 * 24; // 1 days in seconds
|
|
2
|
-
export const MAX_LOCK_ROUNDS: number = 1460; // 4 years in days
|
|
4
|
+
export const MAX_LOCK_ROUNDS: number = IS_VE_SCA_TEST ? 9 : 1460; // 4 years in days (or 9 days for testing)
|
|
3
5
|
export const MAX_LOCK_DURATION: number =
|
|
4
6
|
MAX_LOCK_ROUNDS * UNLOCK_ROUND_DURATION; // 4 years in seconds
|
|
5
7
|
|
|
@@ -511,20 +511,22 @@ export const getObligationAccount = async (
|
|
|
511
511
|
);
|
|
512
512
|
|
|
513
513
|
// for veSCA
|
|
514
|
-
|
|
515
|
-
// console.log(
|
|
516
|
-
// 'borrowIncentiveAccount.amount',
|
|
517
|
-
// borrowIncentiveAccount.debtAmount
|
|
518
|
-
// );
|
|
519
|
-
const weightScale = BigNumber('1000000000000');
|
|
520
|
-
|
|
514
|
+
const weightScale = BigNumber(1_000_000_000_000);
|
|
521
515
|
const boostValue = BigNumber(accountPoint.weightedAmount)
|
|
522
516
|
.div(
|
|
523
517
|
BigNumber(borrowIncentiveAccount.debtAmount)
|
|
524
518
|
.multipliedBy(poolPoint.baseWeight)
|
|
525
519
|
.dividedBy(weightScale)
|
|
526
520
|
)
|
|
527
|
-
.
|
|
521
|
+
.isFinite()
|
|
522
|
+
? BigNumber(accountPoint.weightedAmount)
|
|
523
|
+
.div(
|
|
524
|
+
BigNumber(borrowIncentiveAccount.debtAmount)
|
|
525
|
+
.multipliedBy(poolPoint.baseWeight)
|
|
526
|
+
.dividedBy(weightScale)
|
|
527
|
+
)
|
|
528
|
+
.toNumber()
|
|
529
|
+
: 1;
|
|
528
530
|
|
|
529
531
|
if (availableClaimAmount.isGreaterThan(0)) {
|
|
530
532
|
rewards.push({
|
package/src/utils/query.ts
CHANGED
|
@@ -510,7 +510,7 @@ export const calculateBorrowIncentivePoolPointData = (
|
|
|
510
510
|
.multipliedBy(rateYearFactor)
|
|
511
511
|
.multipliedBy(rewardCoinPrice);
|
|
512
512
|
|
|
513
|
-
const weightScale = BigNumber(
|
|
513
|
+
const weightScale = BigNumber(1_000_000_000_000);
|
|
514
514
|
const rewardRate = rewardValueForYear
|
|
515
515
|
.multipliedBy(
|
|
516
516
|
BigNumber(parsedBorrowIncentivePoolPointData.baseWeight).dividedBy(
|