Deframe
  • 🏠Getting Started
  • 🏗️Architecture Overview
  • Tutorial Guides
    • Loans
      • How to quote for a new loan
      • How to execute a new loan
      • How to get current position of a loan
      • How to repay a loan
    • Yield
      • How to check protocol info
      • How to deposit
      • How to check open positions
      • How to withdraw
    • Swaps
      • EVM
        • How to execute a swap
        • How to get a quote
      • Solana
        • How to execute a swap
        • How to get a quote
  • ⚙️API
    • GET /strategies
    • GET /strategies/:id
    • GET /strategies/:id/bytecode
    • GET /wallets/:address
  • 🔒Protocols
  • 🗳️Widget Integration
Powered by GitBook
On this page
  • Prerequisites
  • How to Get Current Position of a Loan
  • Next Steps
  1. Tutorial Guides
  2. Loans

How to get current position of a loan

PreviousHow to execute a new loanNextHow to repay a loan

Last updated 3 months ago

In this section, we'll learn how to retrieve the current position of an address that has executed a loan.

Prerequisites

How to Get Current Position of a Loan

  1. Request Current Position Use the following endpoint to retrieve all the current positions of an address:

    GET /wallets/:address

    Required Parameters:\

    Parameter
    Description
    Example

    address

    Wallet address

    0x1234567890123456789012345678901234567890

    Example Request:

    GET /wallets/0x1234567890123456789012345678901234567890

    Response:

    {
      "address": "0x1234567890123456789012345678901234567890",
      "stats": {
        "underlying": [
          {
            "asset": {
              "address": "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
              "decimals": "18", 
              "symbol": "WETH",
              "name": "Wrapped Ether"
            },
            "balance": {
              "raw": 19887853736379464,
              "humanized": 0.019887853736379465,
              "decimals": "18"
            },
            "balanceUSD": "51.734075045906536",
            "price": 2601.29,
            "liquidationThreshold": 0.83
          }
        ],
        "debt": [
          {
            "asset": {
              "address": "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
              "decimals": "6",
              "symbol": "USDC", 
              "name": "USD Coin"
            },
            "balance": {
              "raw": 27090825,
              "humanized": "27.090825",
              "decimals": "6"
            },
            "balanceUSD": "27.090825",
            "borrowRate": 0.073019171761316
          }
        ],
        "healthFactor": 1.585,
        "ltv": 0.8,
        "liquidationPrice": 1641.180019997122,
        "maxBorrowValue": -5.620099685948787
      }
    }

The response will return an array of objects, each representing a different protocol.

Next Steps

After retrieving protocol information, you can proceed to:

How to Execute a New Loan
Quote for a New Loan
Execute a Loan