@scallop-io/sui-scallop-sdk 1.4.26 → 1.4.28
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 +14 -14
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/src/queries/portfolioQuery.ts +7 -8
package/package.json
CHANGED
|
@@ -435,13 +435,11 @@ export const getObligationAccount = async (
|
|
|
435
435
|
marketCollateral.liquidationFactor
|
|
436
436
|
);
|
|
437
437
|
|
|
438
|
-
const poolSizeAmount = BigNumber(marketCollateral.maxDepositAmount).minus(
|
|
439
|
-
|
|
440
|
-
);
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
poolSizeAmount
|
|
444
|
-
);
|
|
438
|
+
// const poolSizeAmount = BigNumber(marketCollateral.maxDepositAmount).minus(
|
|
439
|
+
// marketCollateral.depositAmount
|
|
440
|
+
// );
|
|
441
|
+
|
|
442
|
+
const availableDepositAmount = BigNumber(coinAmount);
|
|
445
443
|
const availableDepositCoin = availableDepositAmount.shiftedBy(
|
|
446
444
|
-1 * coinDecimal
|
|
447
445
|
);
|
|
@@ -766,7 +764,8 @@ export const getObligationAccount = async (
|
|
|
766
764
|
.shiftedBy(marketPool.coinDecimal)
|
|
767
765
|
.dividedBy(marketPool.coinPrice);
|
|
768
766
|
estimatedAvailableBorrowAmount =
|
|
769
|
-
obligationAccount.totalAvailableCollateralValue !== 0
|
|
767
|
+
obligationAccount.totalAvailableCollateralValue !== 0 &&
|
|
768
|
+
BigNumber(marketPool.maxBorrowCoin).isGreaterThan(marketPool.borrowCoin)
|
|
770
769
|
? minBigNumber(
|
|
771
770
|
estimatedAvailableBorrowAmount
|
|
772
771
|
// Note: reduced chance of failure when calculations are inaccurate
|