Lending
Lenders supply loan token to specific tranches to earn yield. When a lender supplies to a tranche, their supply may be utilized by borrowers in more senior tranches.
Supply
Lenders specify either assets or shares. Optional callback data and irmData passed to IRM during interest accrual.
supply() accrues borrow interest for all tranches up to and including trancheIndex.
function supply(
MarketParams memory marketParams, // The market parameters.
uint256 trancheIndex, // The index of the tranche to supply to.
uint256 assets, // The amount of assets to supply (use 0 if supplying by shares).
uint256 shares, // The amount of shares to supply (use 0 if supplying by assets).
address onBehalf, // The address to supply on behalf of.
bytes calldata data, // Arbitrary data to pass to the callback (if any).
bytes calldata irmData // The IRM data to pass during interest accrual.
) external returns (uint256, uint256);Withdraw
Lenders specify either assets or shares.
Setting shouldAccrueInterest to false opts out of interest accrual (undervalues shares but reduces gas). If true, withdraw() accrues interest for all tranches up to trancheIndex. If false, no accrual occurs.
Optional irmData passed to IRM.
Last updated