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
  • Overview
  • Two Integration Approaches
  • A) Protocol-Specific Approach (Explicit)
  • B) Protocol-Agnostic Approach (Less Explicit)
  • UI Integration Example
  • Next Steps
  1. Tutorial Guides
  2. Yield

How to check protocol info

Overview

Before implementing lending/yield features in your application, you'll need to retrieve essential information such as APY rates, minimum deposit requirements, and other terms. This guide explains how to fetch this data using our Protocol Data API endpoints.

In the yield category, we encompass various passive income-generating activities in DeFi. This includes lending (where users earn interest by providing liquidity), investing in yield-generating vaults (which automatically compound returns), and staking (where users lock tokens to earn rewards). Essentially, any protocol or strategy that allows users to deposit assets and earn passive returns falls under this category. The Protocol Data API provides information about these different yield opportunities, helping you choose the most suitable option for your users' needs.

Two Integration Approaches

A) Protocol-Specific Approach (Explicit)

Use this when you want to work with a specific lending protocol.

  1. Get Available Protocols First, retrieve the list of all supported protocols:

    GET /strategies
  2. Query Protocol Details Then, fetch specific protocol information using:

    GET /strategies/:id

    Required Parameters:

    Parameter
    Description
    Example

    :id

    Strategy ID

    679044af61866a32dd2d39e9

    Example Request:

    GET /strategies/679044af61866a32dd2d39e9

    Response includes:

    • Current APY rate (spotPosition.apy)

    • Inception APY rate (spotPosition.inceptionApy)

    • Average APY rate (spotPosition.avgApy)

    Example Response:

    {
      "spotPosition": {
        "apy": 0.04174561398554853,
        "inceptionApy": 0.13852906926695097,
        "avgApy": 0.06438234415519406
      },
      "strategy": {
        "asset": "0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE",
        "protocol": "Aave",
        "assetName": "DAI",
        "implementationSelector": "AavePolygon", 
        "network": "polygon",
        "startDate": "2023-01-15T14:49:14.447Z",
        "networkId": "137",
        "underlyingAsset": "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
        "assetDecimals": 18,
        "underlyingDecimals": 18,
        "isActive": false,
        "id": "Aave-DAI-polygon",
        "fee": "10",
        "metadata": {
          "PT": {
            "risk": "low",
            "volatility": "low",
            "description": "loren ipslum"
          },
          "EN": {
            "risk": "low",
            "volatility": "low", 
            "description": "loren ipslum"
          }
        },
        "logourl": "https://assetLogo.png"
      }
    }

B) Protocol-Agnostic Approach (Less Explicit)

Let our system automatically select the optimal protocol for your needs.

  1. Use the Generic Endpoint

    GET /strategies/0x0

    Use the same parameters as above, excluding protocol.

    Our system will analyze your requirements and return the best protocol option based on:

    • Highest APY rates

    • Additional reward incentives

    • Current market conditions

    • Protocol reliability

UI Integration Example

Next Steps

After retrieving protocol information, you can proceed to:

  • Execute a deposit

  • Monitor your yield positions

PreviousYieldNextHow to deposit

Last updated 3 months ago

Example UI implementation showing protocol selection
Protocol Selection UI