Supply
Supply Flow
The supply flow enables users to provide collateral to a third-party lender. The following sections will explain what you need to do to supply successfully.
Transactional Function Sequence
InitiateSupply
Step 1: Supply
function initiateSupply(uint256 value, address onBehalf, string lenderName, bytes supplyData,bool isUnprotected,bytes memory loanInfo, uint256 uniqueId)
value
Ether Value
onBehalf
The users eth address
lenderName
The name of the lender
supplyData
The supply data for the lender. Note inside the data the lender provider address will be based on the network please check (here) for lender provider addresses. The supply data that will be needed is the following -
bytes memory _supplyBytesData = abi.encode(collateralToken_, collateralAmount_ in wei, lenderProviderAddress_, onBehalf_);
unique Id
The unique id that points to a users loan id
isUnprotected
The indication we are working with a forecloseable but unprotected asset
loanInfo
The initial supply info. The loan info that will be need is the following -
bytes memory loanData =
abi.encode(userAddress, lenderName, suppliedAmount in USD, suppliedToken, lender representation token, suppliedTokenDecimals, chainId);
Please check here for the active lender names any name that is passed not in this list will fail!
End of supply
Last updated