Collateral Ratio

async collateralRatio()

Collateral Ratio will calculate the collateral percentage for the loan request that the user will want to create.

  • token:string – is the token you will get from the authentication

  • userRating:number – will be equal to 1

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

  • underlying:string – will be the symbol of asset that the user will want to borrow (ex: Ethereum – “ETH” ; Basic Authentication Token – “BAT”)

  • validity:date – will be the current date + 3 days toISOString().

  • loanTerm:number – will be the duration of the loan.

  • collateral:string – will be the symbol of collateral (ex: Basic Authentication Token – “BAT”).

const response = await this.newBorrowingService.getCollateral({
  token, userRating: 1, loanAmount, underlying, validity,
  loanTerm, collateral 
 })

This is an example of the successful response object of this function:

{
  "status" : "Success",
  "data" : {
    "collateralRatio": 128.71
  }
}

Last updated