@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.js
CHANGED
|
@@ -3107,9 +3107,10 @@ var getObligationAccount = async (query, obligationId, ownerAddress, indexer = f
|
|
|
3107
3107
|
let availableClaimCoin = (0, import_bignumber4.default)(0);
|
|
3108
3108
|
const accountBorrowedAmount = (0, import_bignumber4.default)(accountPoint.weightedAmount);
|
|
3109
3109
|
const baseIndexRate = 1e9;
|
|
3110
|
-
const increasedPointRate = poolPoint.currentPointIndex ?
|
|
3111
|
-
poolPoint.currentPointIndex - accountPoint.index
|
|
3112
|
-
|
|
3110
|
+
const increasedPointRate = poolPoint.currentPointIndex ? Math.max(
|
|
3111
|
+
(0, import_bignumber4.default)(poolPoint.currentPointIndex - accountPoint.index).dividedBy(baseIndexRate).toNumber(),
|
|
3112
|
+
0
|
|
3113
|
+
) : 1;
|
|
3113
3114
|
availableClaimAmount = availableClaimAmount.plus(
|
|
3114
3115
|
accountBorrowedAmount.multipliedBy(increasedPointRate).plus(accountPoint.points)
|
|
3115
3116
|
);
|
|
@@ -3122,7 +3123,7 @@ var getObligationAccount = async (query, obligationId, ownerAddress, indexer = f
|
|
|
3122
3123
|
).isFinite() ? (0, import_bignumber4.default)(accountPoint.weightedAmount).div(
|
|
3123
3124
|
(0, import_bignumber4.default)(borrowIncentiveAccount.debtAmount).multipliedBy(poolPoint.baseWeight).dividedBy(weightScale)
|
|
3124
3125
|
).toNumber() : 1;
|
|
3125
|
-
if (availableClaimAmount.
|
|
3126
|
+
if (availableClaimAmount.isGreaterThanOrEqualTo(0)) {
|
|
3126
3127
|
rewards.push({
|
|
3127
3128
|
coinName: poolPoint.coinName,
|
|
3128
3129
|
coinType: poolPoint.coinType,
|