@scallop-io/sui-scallop-sdk 0.46.32 → 0.46.33
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 +5 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/constants/common.ts +2 -2
- package/src/queries/portfolioQuery.ts +7 -5
package/package.json
CHANGED
package/src/constants/common.ts
CHANGED
|
@@ -18,8 +18,8 @@ export const PROTOCOL_OBJECT_ID = IS_VE_SCA_TEST
|
|
|
18
18
|
// '0x87ddec2984645dbbe2403a509cc6edf393a43acdba9b77d45da2bcbefcf733c1' as const;
|
|
19
19
|
|
|
20
20
|
export const BORROW_FEE_PROTOCOL_ID = IS_VE_SCA_TEST
|
|
21
|
-
? ('0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778' as const)
|
|
22
|
-
: ('0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da' as const);
|
|
21
|
+
? ('0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778' as const) // test environment
|
|
22
|
+
: ('0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da' as const);
|
|
23
23
|
// export const BORROW_FEE_PROTOCOL_ID =
|
|
24
24
|
// '0x87ddec2984645dbbe2403a509cc6edf393a43acdba9b77d45da2bcbefcf733c1' as const;
|
|
25
25
|
|
|
@@ -486,7 +486,6 @@ export const getObligationAccount = async (
|
|
|
486
486
|
)) {
|
|
487
487
|
const coinName = poolCoinName as SupportBorrowIncentiveCoins;
|
|
488
488
|
const borrowIncentivePool = borrowIncentivePools[coinName];
|
|
489
|
-
|
|
490
489
|
if (borrowIncentivePool) {
|
|
491
490
|
const rewards: ObligationBorrowIcentiveReward[] = [];
|
|
492
491
|
for (const rewardCoinName of SUPPORT_BORROW_INCENTIVE_REWARDS) {
|
|
@@ -499,9 +498,12 @@ export const getObligationAccount = async (
|
|
|
499
498
|
const accountBorrowedAmount = BigNumber(accountPoint.weightedAmount);
|
|
500
499
|
const baseIndexRate = 1_000_000_000;
|
|
501
500
|
const increasedPointRate = poolPoint.currentPointIndex
|
|
502
|
-
?
|
|
503
|
-
poolPoint.currentPointIndex - accountPoint.index
|
|
504
|
-
|
|
501
|
+
? Math.max(
|
|
502
|
+
BigNumber(poolPoint.currentPointIndex - accountPoint.index)
|
|
503
|
+
.dividedBy(baseIndexRate)
|
|
504
|
+
.toNumber(),
|
|
505
|
+
0
|
|
506
|
+
)
|
|
505
507
|
: 1;
|
|
506
508
|
availableClaimAmount = availableClaimAmount.plus(
|
|
507
509
|
accountBorrowedAmount
|
|
@@ -530,7 +532,7 @@ export const getObligationAccount = async (
|
|
|
530
532
|
.toNumber()
|
|
531
533
|
: 1;
|
|
532
534
|
|
|
533
|
-
if (availableClaimAmount.
|
|
535
|
+
if (availableClaimAmount.isGreaterThanOrEqualTo(0)) {
|
|
534
536
|
rewards.push({
|
|
535
537
|
coinName: poolPoint.coinName,
|
|
536
538
|
coinType: poolPoint.coinType,
|