@scallop-io/sui-scallop-sdk 0.44.8 → 0.44.9

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": "0.44.8",
3
+ "version": "0.44.9",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -1,5 +1,5 @@
1
1
  export const API_BASE_URL = 'https://sui.api.scallop.io';
2
- export const SDK_API_BASE_URL = 'https://sui-scallop-sdk-api.vercel.app';
2
+ export const SDK_API_BASE_URL = 'https://sdk.api.scallop.io';
3
3
 
4
4
  export const ADDRESSES_ID = '6462a088a7ace142bb6d7e9b';
5
5
 
@@ -358,7 +358,14 @@ export const getObligationAccount = async (
358
358
  const requiredCollateralValue = depositedValue.multipliedBy(
359
359
  marketCollateral.liquidationFactor
360
360
  );
361
- const availableDepositAmount = BigNumber(coinAmount);
361
+
362
+ const poolSizeAmount = BigNumber(marketCollateral.maxDepositAmount).minus(
363
+ marketCollateral.depositAmount
364
+ );
365
+ const availableDepositAmount = minBigNumber(
366
+ BigNumber(coinAmount),
367
+ poolSizeAmount
368
+ );
362
369
  const availableDepositCoin = availableDepositAmount.shiftedBy(
363
370
  -1 * coinDecimal
364
371
  );