Borrowing
Borrowers deposit collateral to specific tranches and borrow loan tokens against it. Each tranche has its own collateralToken, lltv, and oracle which is independent of the other tranches in the market.
Borrow
function borrow(
MarketParams memory marketParams, // The market parameters.
uint256 trancheIndex, // The index of the tranche to borrow from.
uint256 assets, // The amount of assets to borrow (use 0 if borrowing by shares).
uint256 shares, // The amount of shares to borrow (use 0 if borrowing by assets).
address onBehalf, // The address to borrow on behalf of.
address receiver, // The address to send the borrowed assets to.
bytes calldata irmData // The IRM data to pass during interest accrual.
) external returns (uint256, uint256);Borrowers specify either assets or shares.
Accrues interest only for the specified tranche.
Borrow amount must be less than or equal to free supply for the tranche.
The borrower's position must remain healthy after the borrow.
Repay
function repay(
MarketParams memory marketParams, // The market parameters.
uint256 trancheIndex, // The index of the tranche to repay to.
uint256 assets, // The amount of assets to repay (use 0 if repaying by shares).
uint256 shares, // The amount of shares to repay (use 0 if repaying by assets).
address onBehalf, // The address to repay 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);Borrowers specify either assets or shares.
Accrues interest only for the specified tranche.
Optional callback data for ILotusRepayCallback.
Supply Collateral
Supplies collateral increasing the borrower's capacity.
Does not accrue interest.
Optional callback data for ILotusSupplyCollateralCallback.
Withdraw Collateral
Accrues interest only for the specified tranche.
Last updated