Calculate Collateral Amount

async getRequiredCollateralAmount ()

This function will calculate the collateral amount needed for the loan request that the user will want to create.

  • loanAmount:number – will be the amount the user wants to borrow.

  • underlying:object – will be the object of the underlying asset that you will get from Validators.

  • collateral:object – will be the object of the collateral asset that you will get from Validators.

  • collateralPercentage:number - will be the response of what you will get from Collateral Ratio.

const response = await this.newBorrowingService.getRequiredCollateralAmount(
  loanAmount, underlying, collateral, collateralPercentage
 )

Last updated