@scallop-io/sui-scallop-sdk 1.4.26 → 1.4.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "1.4.26",
3
+ "version": "1.4.27",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -435,13 +435,11 @@ export const getObligationAccount = async (
435
435
  marketCollateral.liquidationFactor
436
436
  );
437
437
 
438
- const poolSizeAmount = BigNumber(marketCollateral.maxDepositAmount).minus(
439
- marketCollateral.depositAmount
440
- );
441
- const availableDepositAmount = minBigNumber(
442
- BigNumber(coinAmount),
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