@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/dist/index.mjs
CHANGED
|
@@ -3034,9 +3034,10 @@ var getObligationAccount = async (query, obligationId, ownerAddress, indexer = f
|
|
|
3034
3034
|
let availableClaimCoin = BigNumber4(0);
|
|
3035
3035
|
const accountBorrowedAmount = BigNumber4(accountPoint.weightedAmount);
|
|
3036
3036
|
const baseIndexRate = 1e9;
|
|
3037
|
-
const increasedPointRate = poolPoint.currentPointIndex ?
|
|
3038
|
-
poolPoint.currentPointIndex - accountPoint.index
|
|
3039
|
-
|
|
3037
|
+
const increasedPointRate = poolPoint.currentPointIndex ? Math.max(
|
|
3038
|
+
BigNumber4(poolPoint.currentPointIndex - accountPoint.index).dividedBy(baseIndexRate).toNumber(),
|
|
3039
|
+
0
|
|
3040
|
+
) : 1;
|
|
3040
3041
|
availableClaimAmount = availableClaimAmount.plus(
|
|
3041
3042
|
accountBorrowedAmount.multipliedBy(increasedPointRate).plus(accountPoint.points)
|
|
3042
3043
|
);
|
|
@@ -3049,7 +3050,7 @@ var getObligationAccount = async (query, obligationId, ownerAddress, indexer = f
|
|
|
3049
3050
|
).isFinite() ? BigNumber4(accountPoint.weightedAmount).div(
|
|
3050
3051
|
BigNumber4(borrowIncentiveAccount.debtAmount).multipliedBy(poolPoint.baseWeight).dividedBy(weightScale)
|
|
3051
3052
|
).toNumber() : 1;
|
|
3052
|
-
if (availableClaimAmount.
|
|
3053
|
+
if (availableClaimAmount.isGreaterThanOrEqualTo(0)) {
|
|
3053
3054
|
rewards.push({
|
|
3054
3055
|
coinName: poolPoint.coinName,
|
|
3055
3056
|
coinType: poolPoint.coinType,
|