EcosystemNFTsDocs

Footer

Xchange

  • Swap
  • Liquidity
  • Loans
  • Fund
  • Vote

Tokens

  • X7R
  • X7DAO
  • X7D
  • X7101-X7105

Explore

  • Dashboard
  • Guides
  • Integration
  • Whitepaper
  • Breakdowns
  • Onchains
  • FAQs

Community

  • Telegram
  • Twitter
  • Discord
  • Warpcast
  • Blog
  • Links

Permissionless Trustless Decentralized Exchange

Launch your project on Xchange with 10-1000x the initial liquidity across multiple blockchains where anyone can Swap, Borrow and Lend!

X7 Finance·Trust No One. Trust Code. Long Live DeFi.
  • Telegram
  • Twitter
  • Discordś
  • Warpcast
  • YouTube
  • Reddit
  • GitHub
  • Pioneer 1488 avatar
    Guides
    View
  • Pioneer 1488 avatar
    Integration
    View
  • Pioneer 1488 avatar
    Whitepaper
    View
  • Pioneer 1488 avatar
    Breakdowns
    View
  • Pioneer 1488 avatar
    Onchains
    View
  • Pioneer 1488 avatar
    FAQ
    View
    • Intro

Loan quote

getDiscountedQuote

Before taking out a loan on the X7 platform, it's prudent to first get a quote. This allows you to understand the terms, interest, and other costs associated with the desired loan amount and term. The getDiscountedQuote function provides this service, giving potential borrowers a comprehensive view of the loan's structure tailored according to a specific borrower, loan term, amount, and duration.

This function facilitates borrowers to anticipate the financial implications of the loan. Requires an on-chain lookup.

ParameterDescription
borrowerThe address of the potential borrower seeking the loan quote.
loanTermContract address of the specific IX7InitialLiquidityLoanTerm you're interested in.
loanAmountThe principal amount you're considering borrowing.
loanDurationSecondsThe duration of the loan you're considering, in seconds.

Prerequisites

Determine the exact amount and duration you are considering for the loan. Ensure you are calling the function from a relevant address or have necessary permissions otherwise.

IX7LendingPoolV1 lendingPool = IX7LendingPoolV1(0x740015c39da5d148fca25a467399d00bce10c001); address borrower = msg.sender; // or another Ethereum address address loanTerm = 0xYourLoanTermContractAddress; // replace with the contract address of the desired loan term uint256 desiredLoanAmount = 100 ether; // change as per requirement (assuming Ether-based loan) uint256 desiredLoanDuration = 30 days; // loan duration in seconds // Call the getDiscountedQuote function to get the loan details. uint256[7] memory loanDetails = lendingPool.getDiscountedQuote(borrower, loanTerm, desiredLoanAmount, desiredLoanDuration); // The loanDetails array will contain various metrics about the loan. You can then use these metrics to make an informed borrowing decision.

After calling the function, you can parse the loanDetails array to understand the specifics of the loan, including the interest, fees, and other essential metrics. Always ensure to replace placeholders with relevant values before querying the network.

Next
Intro →

-

  • Pioneer 1488 avatar
    Guides
    View
  • Pioneer 1488 avatar
    Integration
    View
  • Pioneer 1488 avatar
    Whitepaper
    View
  • Pioneer 1488 avatar
    Breakdowns
    View
  • Pioneer 1488 avatar
    Onchains
    View
  • Pioneer 1488 avatar
    FAQ
    View

On this page

  1. Prerequisites