Danogo
  • INTRODUCTION
    • Danogo
    • Litepaper
      • Danogo Fixed Pool Lending
      • Danogo Flexible Pool Lending
  • Follow Us
  • Blogs
    • Cardano Smart Contract Composability Challenges
    • Danogo Multi-Source Oracle Aggregation
    • Handle concurrency in a market crash
    • Fixed Pool Lending Early Adopter Rewards Program
    • Prevent LP Price Manipulation
    • Danogo Flexible Pool Incentivized Testnet
  • HOW TO USE
    • Getting Started
      • Ready with your Cardano Wallet
      • Connecting Wallet
    • Guides
      • Yield Aggregator
        • How to find the most suitable yield products?
        • How to Supply Liquidity?
        • How to Withdraw Liquidity?
        • How to Borrow Tokens?
        • How to Repay a Loan?
      • Danogo Staking Bond
        • How to Borrow ADA Staking Rights?
        • How to Provide Liquidity?
      • Danogo Bond Dex
        • How to buy a Bond at Market price?
        • How to buy a Bond at your desired price (create Buy order)
        • How to sell a Bond at Market price?
        • How to sell a Bond at your desired price? (create Sell order)
        • How to update Sell order (Listing)?
      • Fixed Pool Lending
        • How to Create a Pool
        • How to Create a Loan
        • How To Repay a Loan
        • Top-up Collateral
        • How To Redeem
        • How To Perform Mass Liquidation
      • Flexible Pool Lending
        • How To Supply Assets
        • How To Withdraw Assets
        • How To Borrow
        • How To Modify Loans
        • How To Repay Loan
    • Video Guides
    • FAQ
      • Danogo Dex
      • Danogo Staking Bond
      • Yield Aggregator
      • Fixed Pool Lending
  • Developers
    • Integration
      • How to build transaction to create a fixed rate loan
      • APIs
        • Loan
        • Utility
        • Models
Powered by GitBook
On this page
  1. Developers
  2. Integration
  3. APIs

Utility

PreviousLoanNextModels
  • POSTCalculate max loan amount
  • POSTCalculate health factor

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
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

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
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"
  }
}