@scallop-io/sui-scallop-sdk 2.3.6 → 2.3.7
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 +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/queries/portfolioQuery.ts +4 -4
package/package.json
CHANGED
|
@@ -451,10 +451,10 @@ export const getObligationAccount = async (
|
|
|
451
451
|
|
|
452
452
|
const marketCollateral = market.collaterals[assetCoinName];
|
|
453
453
|
const coinDecimal = query.utils.getCoinDecimal(assetCoinName);
|
|
454
|
-
const coinPrice = coinPrices?.[assetCoinName];
|
|
454
|
+
const coinPrice = coinPrices?.[assetCoinName] ?? 0;
|
|
455
455
|
const coinAmount = coinAmounts?.[assetCoinName] ?? 0;
|
|
456
456
|
|
|
457
|
-
if (marketCollateral
|
|
457
|
+
if (marketCollateral) {
|
|
458
458
|
const depositedAmount = BigNumber(collateral?.amount ?? 0);
|
|
459
459
|
const depositedCoin = depositedAmount.shiftedBy(-1 * coinDecimal);
|
|
460
460
|
const depositedValue = depositedCoin.multipliedBy(coinPrice);
|
|
@@ -520,10 +520,10 @@ export const getObligationAccount = async (
|
|
|
520
520
|
|
|
521
521
|
const marketPool = market.pools[assetCoinName];
|
|
522
522
|
const coinDecimal = query.utils.getCoinDecimal(assetCoinName);
|
|
523
|
-
const coinPrice = coinPrices?.[assetCoinName];
|
|
523
|
+
const coinPrice = coinPrices?.[assetCoinName] ?? 0;
|
|
524
524
|
const coinAmount = coinAmounts?.[assetCoinName] ?? 0;
|
|
525
525
|
|
|
526
|
-
if (marketPool
|
|
526
|
+
if (marketPool) {
|
|
527
527
|
const increasedRate = debt?.borrowIndex
|
|
528
528
|
? marketPool.borrowIndex / Number(debt.borrowIndex) - 1
|
|
529
529
|
: 0;
|