diff --git a/src/facade/borrow/borrow.ts b/src/facade/borrow/borrow.ts index f72dac7..2193d0a 100644 --- a/src/facade/borrow/borrow.ts +++ b/src/facade/borrow/borrow.ts @@ -88,16 +88,11 @@ export class Borrow { async getCollateralValue( getCollateralValueOption: BorrowQueriesOptions, ): Promise { - // only bLuna is supported now, and the below requests are only about bLuna const oraclePrice = await queryOraclePrices({ lcd: this._lcd, limit: 30 })( this._addressProvider, ); const collaterals = await this.getCollaterals(getCollateralValueOption); - if (collaterals.length === 1 && collaterals[0] === null) { - return new Dec(0).toString(); - } - const total = collaterals.reduce((sum, collateral) => { const collateralPrice = oraclePrice.prices.find( (p) => p.asset === collateral.collateral, @@ -126,13 +121,9 @@ export class Borrow { const userBalance = await queryCustodyBorrower({ lcd: this._lcd, ...getCollateralsOption, - custody: getCollateralsOption.market, + custody: whitelist.custody_contract, })(this._addressProvider); - if (userBalance.balance === '0') { - return null; - } - return { collateral: whitelist.collateral_token, balance: new Dec(userBalance.balance).toString(),