Utility
Calculate max loan amount of a pool, based on collateral amount and health factor
Body
loanTokenstring · {policyId}.{assetName}RequiredExample:
Token id of loan token
29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e
healthFactornumber · doubleRequiredExample:
Health factor of this loan
1.23
borrowRateinteger | nullableOptionalExample:
Borrow rate of this Pool in bais point, used for calculating max loan amount of Fixed Pool
500
loanDurationinteger | nullableOptionalExample:
Loan duration in days, used for calculating max loan amount of Fixed Pool
7
Responses
200
Success
application/json
Responseall of
default
An unexpected error response
application/json
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 of a loan, based on loan amount and collateral amount
Body
loanTokenstring · {policyId}.{assetName}RequiredExample:
Token id of loan token
29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e
loanAmountstring · bigintRequiredExample:
Loan amount
1231354
Responses
200
Success
application/json
Responseall of
default
An unexpected error response
application/json
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"
}
}