Utility

Calculate max loan amount

post
  • Calculate max loan amount of a pool, based on collateral amount and health factor

Body
loanTokenstring · {policyId}.{assetName}Required

Token id of loan token

Example: 29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e
healthFactornumber · doubleRequired

Health factor of this loan

Example: 1.23
borrowRateinteger | nullableOptional

Borrow rate of this Pool in bais point, used for calculating max loan amount of Fixed Pool

Example: 500
loanDurationinteger | nullableOptional

Loan duration in days, used for calculating max loan amount of Fixed Pool

Example: 7
Responses
200
Success
application/json
Responseall of
post
POST /api/v1/calculate-max-loan-amount HTTP/1.1
Host: danogo-lending.preview.tekoapis.net
Content-Type: application/json
Accept: */*
Content-Length: 297

{
  "loanToken": "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e",
  "healthFactor": 1.23,
  "collateralTokens": [
    {
      "collateralToken": "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e",
      "collateralAmount": "1231354",
      "liquidationThreshold": 8100
    }
  ],
  "borrowRate": 500,
  "loanDuration": 7
}
{
  "code": 1,
  "traceId": "text",
  "message": "text",
  "data": {
    "maxBorrowAmount": "1231354",
    "maxLoanAmount": "1231354"
  }
}

Calculate health factor

post
  • Calculate health factor of a loan, based on loan amount and collateral amount

Body
loanTokenstring · {policyId}.{assetName}Required

Token id of loan token

Example: 29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e
loanAmountstring · bigintRequired

Loan amount

Example: 1231354
Responses
200
Success
application/json
Responseall of
post
POST /api/v1/calculate-health-factor HTTP/1.1
Host: danogo-lending.preview.tekoapis.net
Content-Type: application/json
Accept: */*
Content-Length: 266

{
  "loanToken": "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e",
  "loanAmount": "1231354",
  "collateralTokens": [
    {
      "collateralToken": "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e",
      "collateralAmount": "1231354",
      "liquidationThreshold": 8100
    }
  ]
}
{
  "code": 1,
  "traceId": "text",
  "message": "text",
  "data": {
    "healthFactor": 1.23,
    "totalCollateralAmount": "1231354"
  }
}