📋Smart Contract APIs
🏛️ DreamLend Contract API
Core Functions
createLoanOffer
createLoanOfferfunction createLoanOffer(
address tokenAddress,
uint256 amount,
uint256 interestRate,
uint256 duration,
address collateralAddress,
uint256 collateralAmount,
uint256 minCollateralRatioBPS,
uint256 liquidationThresholdBPS,
uint256 maxPriceStaleness
) external returns (uint256 loanId)acceptLoanOffer
acceptLoanOfferrepayLoan
repayLoanmakePartialRepayment
makePartialRepaymentliquidateLoan
liquidateLoanaddCollateral
addCollateralremoveCollateral
removeCollateralView Functions
getLoan
getLoancalculateTotalRepayment
calculateTotalRepaymentcalculateInterest
calculateInterestgetLoanHealthFactor
getLoanHealthFactorisLoanLiquidatable
isLoanLiquidatableData Structures
LoanOffer
LoanOfferLoanStatus
LoanStatusEvents
LoanOfferCreated
LoanOfferCreatedLoanOfferAccepted
LoanOfferAcceptedLoanRepaid
LoanRepaidLoanLiquidated
LoanLiquidated🎁 RewardsDistributor Contract API
Core Functions
startAccruingRewards
startAccruingRewardsstopAccruingRewards
stopAccruingRewardsclaimRewards
claimRewardsgetAccumulatedRewards
getAccumulatedRewards💎 DreamerToken Contract API
mint
mintburn
burn🔮 Oracle Integration API
DIA Oracle V2
latestRoundData
latestRoundData🛠️ Integration Examples
Creating a Loan Offer
Accepting a Loan
Checking Loan Health
🔐 Security Considerations
Access Control
Price Feed Security
Reentrancy Protection
Last updated
